Questions tagged [android-appwidget]

Android App Widgets are custom views that can be placed on the home screen of an Android device.

Android App Widgets are custom views that can be placed on the homescreen of an Android device.

Useful links

992 questions
9
votes
3 answers

Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

I am coming across an error when I am updating my RemoteViews in my AppWidget. .. !!! FAILED BINDER TRANSACTION !!! This is caused because all the changes to the RemoteViews are serialised (e.g. setInt and setImageViewBitmap ). The bitmaps are…
Ash McConnell
  • 1,340
  • 1
  • 17
  • 28
9
votes
2 answers

Some 3rd party widgets stop updating after application upgrade

My application hosts user installed widgets, same as a launcher application. Once I bind the widget, everything works fine. Widgets are created, updated automatically, I can click to navigate inner views. Everything keeps working fine, until I…
Lior Iluz
  • 26,213
  • 16
  • 65
  • 114
9
votes
1 answer

How can I get the correct DisplayMetrics from an AppWidget in Android?

I need to determine the screen density at runtime in an Android AppWidget. I've set up an HDPI emulator device (avd). If set up a regular executable project, and insert this code into the onCreate method: DisplayMetrics dm =…
ManicBlowfish
  • 2,258
  • 2
  • 21
  • 29
9
votes
3 answers

AppWidgetManager.getAppWidgetIds in activity returns an empty list

I have an appwidget that I'm trying to update from an activity. To do that, I need the appwidget id. I've used AppWidgetManager.getAppWidgetIds but it always returns an empty list. I also used AppWidgetManager.getInstalledProviders to make sure that…
Ran
  • 4,117
  • 4
  • 44
  • 70
9
votes
2 answers

Replacing RemoteViewsFactory on app widget update

My app widget functions in a number of modes. For each of these modes, I created a RemoteViewsFactory. To switch between modes, I send an intent to my AppWidgetProvider. Upon receiving it, I create the RemoteViews and pass it to AppWidgetManager's…
Yulia Rogovaya
  • 924
  • 1
  • 8
  • 26
8
votes
4 answers

AsyncTask for updating widget - how to access textviews in onPostExecute()?

Following situation: I have an app widget which polls data from an url and updates the widget with the parsed html. On pre-honeycomb devices this can be done via a service without using a seperate thread. Now, on ICS, this has changed and an…
skyworxx
  • 101
  • 2
  • 5
8
votes
2 answers

Set position of TextView in RemoteView during runtime

Dear all, I am trying to set the position of a TextView within an appwidget. Basically, the direct access to properties af the TextView works: myRemoteView.setTextColor(R.id.myTextView, Color.WHITE); //works Also indirectly, I can access the…
Oliver
  • 81
  • 3
8
votes
2 answers

Long-running operation to update an Android appwidget

I have a widget that needs to perform a potentially long-running operation in onUpdate(). Just performing the operation directly resulted in ANR's. To solve this, my first attempt was to create a thread therein. I noticed that the widget would not…
Jeffrey Blattman
  • 22,176
  • 9
  • 79
  • 134
8
votes
2 answers

How to obtain the installed widget list?

I'm trying to read the available home screen widgets list on Android. I can populate a grid using the available applications list using Intent myIntent = new Intent(Intent.ACTION_MAIN,…
lorenzoff
  • 1,120
  • 3
  • 15
  • 32
8
votes
2 answers

Android: enable/disable app widgets programmatically

Question: Is there a way to enable some of the homescreen widgets that I give out with my app programmatically? For example, having a "premium" widget and giving access to it only after payment? As the Android docs say, one should add a broadcast…
frangulyan
  • 3,580
  • 4
  • 36
  • 64
8
votes
0 answers

E/AppWidgetHostView: Package name not found

I write an android App Widget and it works fine. After some time I had to change its package name But it works well yet. I already had getPackageName, and it prints the correct package name in the log, and still sometimes after I upgrade the app…
faeze saghafi
  • 650
  • 10
  • 25
8
votes
1 answer

How to open launcher's widget picker?

I want to open the launcher's widget picker (for example, the one we get when we long press on home screen) from my Activity. What I want to achieve is, I want to take the user to my widget so that there are more chances that he will consider adding…
Mangesh
  • 5,491
  • 5
  • 48
  • 71
8
votes
1 answer

Example of using loadLabel(android.content.pm.PackageManager) to set a label to Android Widget

In Android API from API level 21 field label is deprecated and advised to use loadLabel(android.content.pm.PackageManager) instead. Just curious if anybody happen to find any example of how to use loadLabel(...) to set the label to Android…
user3735181
  • 103
  • 1
  • 4
8
votes
4 answers

Android updateAppWidget doesn't update

I got a serious issue on my Android application: Calling AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); appWidgetManager.updateAppWidget(appWidgetId, getWidgetView(context, appWidgetId)); in the public void…
Manitoba
  • 8,522
  • 11
  • 60
  • 122
8
votes
6 answers

AppWidgetHost not updating widgets

Can I use AppWidgetHost inside a Fragment? I can't get most widgets added to my AppWidgetHost to update. Here is my scenario.. LauncherActivity.java Very simple, just calling setContentView with a layout. main.xml Contains a couple fragments,…
brockoli
  • 4,516
  • 7
  • 38
  • 45