Questions tagged [appwidgetprovider]

A convenience class in Android to aid in implementing an AppWidget provider.

From the API page.

A convenience class to aid in implementing an AppWidget provider. Everything you can do with AppWidgetProvider, you can do with a regular BroadcastReceiver. AppWidgetProvider merely parses the relevant fields out of the Intent that is received in onReceive(Context,Intent), and calls hook methods with the received extras.

191 questions
3
votes
0 answers

What kind of state is the ACTION_APPWIDGET_RESTORED broadcast about?

I'm searching for the best way to back up the current state of my app widget. I've got a bitmap and I remember its timestamp: private data class TimestampedBitmap(val bitmap : Bitmap, val timestamp : Long) private var tsBitmap: TimestampedBitmap? =…
Marko Topolnik
  • 195,646
  • 29
  • 319
  • 436
3
votes
1 answer

How to migrate old widgets into a new one

The app I am wrorking on has three widgets right now. Each of these widgets has a different size and a fix layout file. Now I've developed a new widget which is resizable and adaptive. It loads a fitting layoutfile according to its size. Now with…
Henning
  • 2,202
  • 1
  • 17
  • 38
3
votes
1 answer

Android - Appwidget with Remoteviews not updating after reboot

I saw similar questions here on SO, but nothing seems to work in my case... I created an appwidget with an AdapterViewFlipper (Simple ViewAnimator that will animate between two or more views that have been added to it). The appwidget has a Next…
3
votes
1 answer

How To Create AppWidget to display JSON Parse Images and Text

I'm New to android development and I don't understand clearly how to create a appwidget for application that parse JSON Data and display in list.
Mukeshkumar S
  • 785
  • 1
  • 14
  • 30
3
votes
1 answer

Android AppWidget onClick not working after garbage collection

I created an AppWidget for my App and setup the updatePeriodMillis to 0, because this Widget is not doing anything, if the user does not interact. Everything works fine, untill Android cleans the ram. Then the widget won't respond anymore until the…
Klumbe
  • 370
  • 2
  • 12
3
votes
2 answers

AppWidgetProvider: onAppWidgetOptionsChanged not being called on widget placement

According to the documentation on onAppWidgetOptionsChanged in AppWidgetProvider: "This is called when the widget is first placed and any time the widget is resized." However, when I place my widget on the stock launcher in Android 4.2 and 4.3, this…
Eric Cochran
  • 8,414
  • 5
  • 50
  • 91
3
votes
1 answer

App Widget won't show in app drawer, seems related to Invalid dimensions

I am getting the following error in LogCat: 03-16 23:33:47.239: E/Rosie.AppsCustomizePag_(19861): Widget WidgetSummary(TestApp/APP_WIDGET/0 x 0/-1/ComponentInfo{com.example.testapp/com.example.testapp.ExampleAppWidgetProvider}/0/false) has…
RyanC
  • 51
  • 4
3
votes
2 answers

setImageViewUri from URL on remote view in android widget

I try to set image from url with remote view. Here is the code that i use : rv = new RemoteViews(mContext.getPackageName(), R.layout.widget_item_default); WidgetItem item = mWidgetItems.get(position); rv.setImageViewUri(R.id.imageDeal,…
Wawanopoulos Ertz
  • 135
  • 1
  • 2
  • 7
3
votes
1 answer

App widget on Android default Lockscreen?

I just want to know whether is it possible to add widget to our Android Lock screen. Actually by selecting widget options in menu in home screen, we add our own or default widgets to home screen. Is it possible to add the following widgets to our…
3
votes
1 answer

Android Widget and click Listener

I'm trying to make a widget with the launch clock application. Why this code doesn't work on real device ? What i'm doing wrong ? @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); …
mr.ANDREW
  • 51
  • 1
  • 7
2
votes
0 answers

Android AppWidget not updating and resetting on app launch

I'm trying to add an AppWidget to my Android app, built with Kotlin, Jetpack Compose, Room and Dagger-Hilt. The general idea is for the widget to display the quote of the day, by picking it from the quoteRepository, which returns a…
zkvvoob
  • 394
  • 1
  • 4
  • 26
2
votes
0 answers

Why does getAppWidgetInfo return null sometimes?

When updating my app widget I need to check the provider class name. appWidgetManager.getAppWidgetInfo(widgetId).provider.className But sometimes I face the exception Fatal Exception: java.lang.NullPointerException: Attempt to read from field…
2
votes
1 answer

How long does a BroadcastReceiver stay active if it is registered in an AppWidgetProvider?

I'm registered a BroadcastReceiver for the ACTION_TIME_TICK inside my AppWidgetProvider to update a clock every minute. Like in this example: AFAIK a BroadcastReceiver that is registered at runtime is only active as long as the application is…
2
votes
1 answer

When exactly is AppWidgetProvider.onRestored() being called?

In which cases should i override onRestored? Are they just referring to the backup which can be enabled/disabled in the manifest? Is it possible that this method get's called when the app get's updated too? Or under any other circumstances where the…
einUsername
  • 1,569
  • 2
  • 15
  • 26
2
votes
3 answers

Android app widgets background shape change color opacity programmatically

I have developed an app widget with round corners. I've basically set a background drawable to the root of the app widget layout. Now I'm trying to change its background opacity without losing round corners. I know that RemoteViews are pretty…
Luca
  • 322
  • 4
  • 19
1 2
3
12 13