appwidgetprovider

Android appwidget remoteviews not updating

北战南征 提交于 2020-01-13 05:58:46
问题 List remote view is not updating (I mean refreshing itself) when I am updating the widget from some activity. It comes up till onUpdate of app widget (log showing up). but does not enter into adaptor of list view to inflate it with fresh data . public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { final int N = appWidgetIds.length; for (int i = 0; i < N; i++) { int appWidgetId = appWidgetIds[i]; Log.e("called", "onupdate"); RemoteViews views = new

Widget does not works after “Clear Memory”

冷暖自知 提交于 2020-01-11 11:25:11
问题 The problem is that after I use the built in Task Manager's Clean Memory/Ram, My widget stops working .I guess this is related to the Task Manager's method of cleaning RAM.After a lot of research and some attempts, I found that i need BroadcastReciever to listen to package changes and updates: So i implemented but its not working because document says that the Restarted/Cleared package does not receive this broadcast register receiver in the manifest file: <receiver android:name="com.app.lab

onDisabled and onDeleted method not being called

故事扮演 提交于 2019-12-24 11:29:28
问题 For some reason, the onDisabled and onDeleted method of my widget is not getting called when i remove the widget from the homescreen. I don't know why. Here's the code: public class WidgetProvider2x1 extends AppWidgetProvider { @Override public void onEnabled(Context context) { Log.i("MyTag", "onEnabled"); super.onEnabled(context); } @Override public void onDeleted(Context context, int[] appWidgetIds) { Log.i("MyTag", "onDeleted"); Toast.makeText(context, "onDeleted", Toast.LENGTH_SHORT).show

Android widget not responding to touches

点点圈 提交于 2019-12-23 01:52:06
问题 I'm trying just some very simple code to get an Android widget going but with no luck. I've looked around everywhere and haven't found a good answer. All I want (for now) is to increment a counter when the widget is touched and display the current value. This is my AppWidgetProvider: public class WordWidget extends AppWidgetProvider { Integer touchCounter = 0; @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { //This is run when a new

Android widget stops working after a while?

泪湿孤枕 提交于 2019-12-19 02:39:09
问题 I have a flashlight app with a widget. The widget is used to turn the flashlight on and off and does not display main activity or anything. After a few hours, however, the widget does nothing. I mean if you click it, nothing happens. I have two classes to accomplish this a Provider and a Receiver . Provider: public class WidgetProvider extends AppWidgetProvider { @ Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Intent receiver = new

AppWidgetProvider: onAppWidgetOptionsChanged not being called on widget placement

巧了我就是萌 提交于 2019-12-14 01:44:13
问题 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 method is not being called immediately (only after I resize the widget). I tried it on my own app, as well as CommonsWare's https://github.com/commonsguy/cw-omnibus/tree/master/AppWidget/Resize Is there something I am missing? EDIT: The only

android AppWidget not adding to homescreen on Lollipop

冷暖自知 提交于 2019-12-10 17:17:16
问题 I developed an app that shows news feed on a home screen widget. Everything is OK on pre-Lollipop android devices as a result of the following scenario: A user enters their launchers' widget screen to choose/add a specific widget A user clicks on MyNewsWidget to add to their home screen A configuration activity is called so user can choose from different news sources A user clicks a "save" button inside the configuration activity, then the activity should finishes and MyNewsWidget should be

Android onEnabled/onDisabled never called

て烟熏妆下的殇ゞ 提交于 2019-12-09 18:20:56
问题 I'm having a problem with triggering of the onEnabled and onDisabled methods of the AppWidgetReciever. I have the actions specified, I also log every action in onRecieve method, but the only two actions I get are "APPWIDGET_UPDATE" and "APPWIDGET_DELETED". I have googled for this solution, but unfortunately found none. Here is my code: Manifest part: <receiver android:name=".ScheduleWidgetProvider" > <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_ENABLED" /> <action