Android :: Changing A Widget's Icon From OnUpdate
Dec 29, 2009
I have a widget that is meant to change its icon every time it receives the Update broadcast. However, the widget never manages to display its icon properly, displaying the text "Problem loading widget". The Logcat message is: WARN/AppWidgetHostView(612): updateAppWidget couldn't find any view, using error view
WARN/ App Widget HostView(612) : android.widget.RemoteViews$ActionException: can't find view: 0x7f060003 The code for my onUpdate is: public class ImageWidgetProvider extends AppWidgetProvider{private static final String TAG = "Steve"; public static final int[] IMAGES = { R.drawable.ic_launcher_alarmclock,/*and many more*/}; @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds){for (int appWidgetId : appWidgetIds) {Log.d(TAG, "onUpdate:"); int imageNum = (new java.util.Random().nextInt(IMAGES.length)); Log.d(TAG, Integer.toString (IMAGES[imageNum])); RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.widget); emoteView.setImageViewResource (R.id.image_in_widget, IMAGES[ imageNum]);Now when I hover the mouse over "R.id.image_in_widget" it brings up that its value is equal to 0x7f060003 - the view that it can't find according to Logcat. Using the second Log statement, I verified that IMAGES[imageNum] does indeed refer to a random image from the IMAGES array. (In case it matters, it comes out as a decimal value rather than a hexadecimal one.) Any ideas what I'm doing wrong? Edit: Here is the layout file for the widget, where the image_in_widget ImageView is declared.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView android:name="@+id/image_in_widget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/
View 4 Replies
Oct 16, 2010
I am writing my first application and am trying to get my widget to load a different image when it is added to the home screen based on the state of the notification volume.It is detecting the notification state fine and the proper Toast messages appear when I add the widget, but I'm not getting any icon.I just get an empty button.I'm using the same code to change the icon in my onReceive() method to do other things and that works fine.Is this the proper way to accomplish that?
View 3 Replies
View Related
Mar 11, 2010
I liked how on my LG Dare that I could drag icons onto the home screen and place them how I want (not locked to a grid). Not only could I arrange them however I wanted, I could also place as many as I could fit (almost). Is there a widget or app that allows me to place a "box" on the home screen to toss apps into. Right now I've found 'More Icons widget" but that only allows me to place 4 icons into the spot of 1, which makes them very tiny and arranges them in a square. Anything else out there?
View 4 Replies
View Related
Jan 7, 2010
I have a Question in my first post.I'm using Ahome on my HTC hero and i really like the theme that i have now but the Icons don't really match (well, some are, some aren't). So my question is :How can i change the icons ? I know how to download icon packs but how do I use the icons and replace them for my current icons?
View 4 Replies
View Related
May 11, 2010
I want to take my activity the entire screen of the device and I could do that by making appropriate changes in the android manifest file (Theme. NoTitleBar .Fullscreen). But, now I just want battery status icon on my screen alongwith other components of my activity. Is that possible?if yes, then how? I tried to use battery manager but, it does not expose such interfaces. I guess its mainly useful for checking and using battery life status and firing intents appropriately. You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@ google groups .com To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
View 2 Replies
View Related
Jul 9, 2010
Is there a way to change an application's icon without upgrading it? The idea is that there are two icons in the drawable folder, both with different names. At some point during the applications runtime, the icon will switch to a different one to alert the user that something occurred. I have looked into doing a widget, but that isn't exactly what I want, since I don't want to send a push notification.
View 2 Replies
View Related
Jun 9, 2009
Does somebody know if this is possibly in 1.5? From: hackbod <hack...@gmail.com> Date: 19 Okt 2008, 20:06 Subject: How can the app icon be changed at runtime To: Android Developers Sorry, application icons can't be changed dynamically in 1.0. On Oct 18, 8:10 am, omni <dbk...@gmail.com> wrote:
View 6 Replies
View Related
Nov 4, 2009
My custom AppWidgetProvider has onUpdate method where i have logic to update RemoteViews
It is not periodically updated by system, but rather, i'd like to trigger onUpdate if something happens (in one of my app Activities). both custom AppWidgetProvider and Activities i'd like to trigger update from run with the same UID
I tried some AppWidgetManager's methods, but no luck, finally i ended with really weird solution: i'm sending broadcast with action ACTION_APPWIDGET_UPDATE and extras EXTRA_APPWIDGET_IDS which i got from AppWidgetManager
Is it a common way of updating AppWidgetProvider?
View 7 Replies
View Related
Feb 14, 2010
I'm new to Android development, and I'm trying to write a small widget. This code works on the emulator and the text is set to "test", but when i run it on my Nexus One it doesn't. It just appear like onUpdate isn't called. Anyone have any good idea what i'm doing wrong?
View 1 Replies
View Related
Aug 20, 2010
I'm currently using tenuis but was wondering what you guys use? I prefer cartoony icons as you might say however find it very hard too find examples of these icons on the net. Because of this its more trial and error when I download a pack. Can you guys show me what your using so I can get a few different ideas? Also guys I'm thinking of changing my web browser from the stock one? Is there any big benefits of doing this? And which browser in your eyes is the best?
View 1 Replies
View Related
Dec 8, 2009
I have a sprint HTC Hero and have made a few folders on it. But I *hate* the grey colored standard icon - how do I change this? Someone recommended "BetterCut" which I downloaded...it lets me change the icons for other shortcuts (which is great) but not for folders. I don't even mind navigating to this on the actual android device and replacing the original files with new ones - just someone please tell me how?
View 6 Replies
View Related
Nov 12, 2010
Is it possible to change the icon images of applications of android home screen like messaging,browser, mailing etc. I am presently refering to the Home sample application in android sdk.But I m not able to implement the change in icon image.Can someone suggest something?
View 2 Replies
View Related
Sep 1, 2010
Just wandering if there is an app available to change the pictures of icons.For example, I would like to change the Handcent SMS icon to the standard messaging icon, and re-label this as messages.
View 1 Replies
View Related
Aug 26, 2009
I know I can save information in a static attribute in a widget, however, is there a way for a widget instance to save the state information similar to the Activity onSaveInstanceState(Bundle outState) method? I don't want to write to a database for this state information.
View 2 Replies
View Related
Sep 19, 2013
I want to change my sms icon im my device but cannot, using xposed and icon themer is not effective
How to find the position of .png for sms on device.
View 2 Replies
View Related
Jun 14, 2010
I feel like an idiot, but I can't for the life of me figure out how to change the name and/or icon of a newly created folder in the Sense UI. Can someone help me out?
View 2 Replies
View Related
Aug 30, 2010
anyone able to do this? iV'e changed in settings but it stays light blue on home screen.
View 1 Replies
View Related
Mar 13, 2010
Can anyone inform me how to change the battery icon in the notification bar
View 1 Replies
View Related
Jan 11, 2013
I have a Galaxy Nexus running JB 4.2 and I've started playing around with (basic) customisation. Is it possible to change the colour of the Status and System Icons at the top of the screen from the default blue? Preferably to white. I have a nice dark look going courtesy of sammyycakes and others, the blue spoils it a bit.
View 6 Replies
View Related
Jul 29, 2010
I just bought Beautiful Widgets for it's compact time/weather widget, (gained another row of icons on home screen) When you first create a widget with this, there are many configuration options, but it appears the only way to change something is to delete the old widget and create another one. Is this true, or is there a way to edit the options for an existing widget? EDIT: Found the answer in another forum. Tap the weather icon. then menu. I'd delete this, but I can't find an option to delete my post.
View 1 Replies
View Related
Aug 17, 2010
I'm attempting to create an incredibly simple widget that changes the text displayed every 5s or so. However I've had major headaches attempting to get this to work. Obviously I can't use the onUpdate call as it's a minimum of every 30min. Currently my solution uses an Timer in an extended Service class, which is as ugly as hell and tends to run like a dog after a while. Is there a "clean" way of doing this, ie. in a manner that doesn't require a Widget, UpdateService, Timers etc.
View 2 Replies
View Related
Nov 19, 2013
My google search bar mic icon goes to an empty mic from times to times. It does that on both my N10 and N5.
I use both devices in Quebec Canada. My phone is setup as english US. Nexus 5
View 5 Replies
View Related
May 29, 2014
Is there something that replicates this feature?: changing a notifications priority/or hiding the notification icon from the status bar.
I know that you can permanently hide all notifications of an app via app info, but what I am looking for is something that will allow me to only hide any icon from the status bar, but the notification will still be there when I pull down the notification shade.
I currently use a ROM that has this feature, and I have yet to find it implemented in any other way or through any other ROM. I would love to go back to stock or an AOSP rom and use only Xposed modules, but this is the only thing that is stopping me. This feature is absolutely vital in my opinion in my everyday use.
You can see this feature in the screenshot below. When I long press any notification when I select the Hide status bar apps notification icon, the icon will not show up. As if it either replaces it (which I believe it does with a transparent dot) or just as useful would be to change the priority of the notification to low.
This just amazes me that I can't find anything else that does this. I'm hoping there is some type of xposed module that can replicate this feature, or anything really. If only i could find the code in the source of the rom myself to compile it into stock or something... Nexus 5
View 3 Replies
View Related
Jul 30, 2010
I am using TAB in my android application. I want to change the Background of each Tab at the load time only. The default color is grey.
View 1 Replies
View Related
Dec 7, 2009
Let's say that I have two layouts for a widget: Layout1 and Layout2. The default for the widget is Layout1, but I allow the user to choose which layout they want the widget to be. So if the user changes to Layout2, how do I programmatically change the layout to Layout2? There isn't a setContentView method for widgets like there is for Activities.
View 2 Replies
View Related
Apr 26, 2010
I have a widget set up and it displays properly in both portrait and landscape when added to each. But when I change orientation it has the problem "Problem Loading Widget". I delete this, re-add the widget, and it displays correctly. Thus, my widget can support both portrait and landscape but it doesn't survive an orientation switch. What am I missing? Do I need to redraw the widget when orientation is changed? Doesn't it do this automatically? Do I need to call onUpdate() somehow?
View 2 Replies
View Related
Apr 28, 2010
I have this really annoying problem:In my widget, i would like to change the background by code. I noticed on the Google doc than I can easily change the background of an Imageview: remoteViews.setImageViewResource (R.id.my_iv, R.drawable.my_bg);Ok, too easy, i want to change now the Linear layout.. What I read about the remoteview id that I can change a Bitmap, Int, Bool, String, etc. but not a drawable. So i guess i cannot use:remoteViews. set Bitmap (R.id.my_ll, "setBackgroundDrawable",BitmapFactory.decodeResource(context.get Resources(), R.drawablemy_bg));I am totally disapointed and tried a last idea: views.setInt (R.id. my_ ll,"setBackground Resource" ,R.drawable.my_bg);But The logcat told me: android. widget. Remote Views $Action Exception: view: android. widget.LinearLayout can't use method with RemoteViews:setBackgroundResource(int)I am totally lost and I really don't know what to do.
View 1 Replies
View Related
Jul 31, 2010
I changed the background color of Tab WIdget in Android. But when I changed the background, I lost the border of each Tab. I want to change the border color of Tab Widget. How can I change it? Is there any other way by which I can show the border?
View 1 Replies
View Related
Nov 21, 2010
I can write a widget with a Button or ImageButton and assign a StateDrawable as background or sourcein order to make an effect when you click it. Besides that I have problems with the side of each button, my main problem is this: how do I change the StateDrawable if I want to change the image of the button from the AppWidgetProvider but still want to preserve the click effect like a StateDrawable. The power control widget in Android does things like that.
View 2 Replies
View Related
Jul 8, 2009
I have a widget , thats working just fine in a particular orientation, but the moment i change the orientation to landscape/portrait, the widget is not able to launch. I have one layout and one layout-land folder in res directory.The problem is that the widget created in landscape mode is not opening in portrait mode and vice-versa.
View 4 Replies
View Related