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
8
votes
1 answer

Calculate height of appwidget

I cannot figure out or find a solution by googling for this problem. I have an android app with an appwidget, looks like http://www.livescorewidget.eu/img/screendumps/widget.png, and I am adding the data rows on the fly. Due to different devices the…
user971769
  • 117
  • 2
  • 6
8
votes
3 answers

Image in Widget

I am trying to set image in image view in widget layout in onUpdate, but image is not updating @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Log.i(TAG, "onUpdate…
8
votes
1 answer

Android AppWidgetManager method updateAppWidget fails to set intents, load data. And it happens randomly

My widget is comprised of 2 buttons and a listview displaying data. Most times, when the widget provider's onUpdate method is called, everything loads normally and everyone is happy. However I've noticed sometimes after the update method is called,…
JMRboosties
  • 15,500
  • 20
  • 76
  • 116
8
votes
2 answers

How do I update an Android AppWidget after upgrading/reinstalling the application?

I created an App (https://play.google.com/store/apps/details?id=com.widget.analytics) that displays one's Google Analytics statistics on the Android home screen using an AppWidget. Unfortunately, after upgrading the app to a new release the users…
jones
  • 668
  • 7
  • 23
7
votes
3 answers

setCompoundDrawables with RemoteViews

I have an appwidget layout with a textview and an imageview. Lint always tells me to replace it with a compound textview. The problem is, how do I call setCompoundDrawables with a RemoteViews? is it possible? thanks. UPDATE:…
Ran
  • 4,117
  • 4
  • 44
  • 70
7
votes
2 answers

View instance from RemoteViews

How can I get View instance from RemoteViews ? There are RemoteViews.reapply and RemoteViews.apply API functions , but I don't know how to use them.
holtaf
  • 787
  • 6
  • 19
7
votes
0 answers

App WIdgets showing inconsistent behaviour

I have created an Appwidget in Android, and provided two buttons but I have found that during interacting with it sometimes, the UPDATE signal is being invoked and some times it doesn't. Following is the implementation of ClockWidgetWorker class…
Rohan Pande
  • 301
  • 1
  • 5
7
votes
1 answer

How to get app widget size?

I have an Android app widget and I would like to extend it to support several sizes and also re-sizable with Honeycomb. The problem is that I need to know what is the size of the widget , so I can know how much content I can put in it. How do I read…
Ran
  • 4,117
  • 4
  • 44
  • 70
7
votes
1 answer

UpdateAppWidget Null Pointer Exception

Following is the static method for updating the appwidget: public static void updateAppWidget(Context context, int id, WALL_POST_DETAILS post){ try{ System.out.println("In updateAppWidget==>"+id); AppWidgetManager…
Veer
  • 2,071
  • 19
  • 24
7
votes
1 answer

Re-using layouts in the case of an AppWidget

I have several very similar layouts for my AppWidget, in fact differing only in the rotation of one of the TextView elements (I select the appropriate layout based on the screen orientation). So rather than repeat the same stuff multiple times (I…
drmrbrewer
  • 11,491
  • 21
  • 85
  • 181
7
votes
2 answers

appwidget listview rows not updating or loading after Marshmallow upgrade

I have a widget app that works with no problem Android Lollipop or lower OS. When I upgraded my nexus 5 into Marshmallow (android 6.0), I realize that my widget has a problem on loading custom row listview. Widget has a dynamic textView and a…
7
votes
1 answer

AppWidget: instance don't be shown after config activity is finished on some devices

I encountered wierd behaviour on some devices when add new instance of appwidget on the home screen. I've got AppWidget application with configuration activity. As it was said in tutorial update of appwidget I have to do by myself. public static…
Alex Zezekalo
  • 1,031
  • 2
  • 17
  • 34
7
votes
3 answers

Auto Screen Rotation Disabling Widget RemoteView onClick event

I have a bit of a strange bug with a widget I've coded- after the screen rotates the widget stops responding to onClick events. The code is exactly the same as in the Android Developer Documentation for App Widgets here. I've noticed other widgets…
Marogian
  • 503
  • 1
  • 8
  • 16
7
votes
2 answers

How to hide partially visible views in Android layout xml without code?

Please read the question fully before answering! Suppose I have two views: first (yellow) in the bottom second (cyan) filling the rest of the view above first The size of the parent view is dynamic. How can I achieve the below Expected column UI…
7
votes
2 answers

ProgressBar in an AppWidget

I ran into an interesting situation with using a ProgressBar in an App Widget... The documentation (http://developer.android.com/guide/topics/appwidgets/index.html) says that ProgressBar is a supported widget class... I have no problem getting the…
Justin
  • 6,564
  • 6
  • 37
  • 34