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
16
votes
2 answers

Removing AppWidgets programmatically

I'm having the hardest time figuring out how to remove home screen AppWidget's programmatically (i.e. without the user actually dragging one into the trash). As an example, consider an app that can have multiple accounts, with any number of widgets…
Melllvar
  • 2,056
  • 4
  • 24
  • 47
16
votes
2 answers

How to update App Widget with list view from an Activity

I know this has been asked for many times but I went through the documentation from top to bottom, read all answers here and none of them helped. To be honest, each answer says something different about how to aproach this. Now back to my…
user219882
  • 15,274
  • 23
  • 93
  • 138
16
votes
4 answers

Appwidget size calculation

It might be me, but when I calculate minimum app widget sizes according to the formula given on the android page I don't get the right widget widths; The formula is as follows: width(n) = (70 x n) - 30 When I want to have a 5x1 widget, the…
15
votes
1 answer

How to load items in android homescreen listview widget?

I am currently developing an Android project which makes use of a Homescreen Widget to display data to the user. The view that I used in the Widget is a ListView. Below are my codes: WidgetService Class public class WidgetService extends…
Torasu
  • 261
  • 1
  • 2
  • 7
15
votes
3 answers

onGetViewFactory only called once for multiple widgets

I have an appwidget which uses ListView. I have created a class that extends RemoteViewsService: public class AppWidgetService extends RemoteViewsService { @Override public RemoteViewsFactory onGetViewFactory(Intent intent) { return…
nhaarman
  • 98,571
  • 55
  • 246
  • 278
14
votes
3 answers

FileProvider error

https://developer.android.com/training/camera/photobasics.html All I am trying to do is take a picture with the Camera, save it and display it in an ImageView. I followed the android tutorial above and keep getting an error (a NullPointerException)…
rafvasq
  • 1,512
  • 3
  • 18
  • 48
14
votes
3 answers

ListView in widget adds randomly items on scrolling and resizing (nested remoteviews)

Update: I created a repository with less code to make it a bit easier to understand. I'm trying to create a widget. I made it like described here: https://stackoverflow.com/a/6093753/2180161 It works partially, but I have a really strange bug. I…
maysi
  • 5,457
  • 12
  • 34
  • 62
14
votes
3 answers

Creating A Digital Clock Widget With A Custom Font

I'm trying to create a digital clock widget with a custom font. And this has proven to be the biggest challenge of my Android experience. (Thought it would be as simple as tc.setTypeFace("whatever") and be done with it) The best way seems to be…
13
votes
2 answers

ACTION_BATTERY_CHANGED firing like crazy

Okay, so I'm working on an AppWidget that checks the battery level and displays it on a TextView. My code looks like this: public class BattWidget extends AppWidgetProvider { private RemoteViews views = new RemoteViews("com.nickavv.cleanwidgets",…
Nick
  • 6,900
  • 5
  • 45
  • 66
13
votes
3 answers

Why is my android alarm manager firing instantly?

I am following sample code for sending an update notification every 10'seconds. The code follows and it is in an UpdateService for an AppWidgetProvider. If I put a Thread.sleep(10*1000); I can see the expected behavior of my servicing loop. I…
mobibob
  • 8,670
  • 20
  • 82
  • 131
13
votes
1 answer

Widget wrong grid size

I've written a widget which is supposed to be 4x2 homescreen blocks. It's minheight and minwidth, with accordance to the current "App Widget Design Guidelines" page are android:minWidth="250dp" android:minHeight="110dp" And a padding is applied…
Nick
  • 6,900
  • 5
  • 45
  • 66
13
votes
4 answers

How to start Activity from Android AppWidget?

Code like this works well. Intent configIntent = new Intent (context, WidgetConfigActivity.class); configIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); PendingIntent pIntent = PendingIntent.getActivity(context, 0,…
oleg.semen
  • 2,901
  • 2
  • 28
  • 56
12
votes
5 answers

Is it possible to create home screen widgets for Android using Ionic Framework or React Native?

Widgets are android native constructs that extend a view on the application screen. Is it possible build a homescreen widget using Ionic or react native?
11
votes
3 answers

app widget setImageViewUri does not update the image

i have an app widget, which contains only one imageview. i redraw that image and store it as png in apps's private memory and then i set the RemoteViews' image with the uri (widget.setImageViewUri(R.id.widget_icon, uri)) instead of sendding the…
shelll
  • 3,234
  • 3
  • 33
  • 67
11
votes
1 answer

App Widget onUpdate not called when onReceive method exists

I have the following code in my AppWidgetProvider class. @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Log.i("Custom", "Update"); } @Override public void onReceive(Context context,…
Leo
  • 537
  • 1
  • 7
  • 16
1
2
3
66 67