android-appwidget

AppWidgetManager getAppWidgetIds returning old Widget ids

有些话、适合烂在心里 提交于 2019-12-03 11:21:54
问题 I'm trying to get a list of all ACTIVE instances of my widget. In the OnUpdate method of my AppWidgetProvider, I'm doing the following: // Get all ids ComponentName thisWidget = new ComponentName(context, this.getClass()); int[] lastWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget); The problem is that if you add a widget to your homescreen and then delete it, getAppWidgetIds still returns a list containing among others the id of the widget you just deleted. Is there a way to retrieve

android appwidget listview not updating

守給你的承諾、 提交于 2019-12-03 07:12:28
I've written an AppWidget that displays some data in a ListView from a ContentProvider, but I have trouble having it update. When I first create the widget it gets populated correctly, but after the AlarmManager's PendingIntent arrives, no updates occurs on the ListView. Here's the code: Intent update = new Intent(context, MenuWidgetProvider.class); update.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE); update.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds); PendingIntent pIUpdate = PendingIntent.getBroadcast(context, 0, update, 0); ((AlarmManager) context.getSystemService

AppWidgetManager getAppWidgetIds returning old Widget ids

被刻印的时光 ゝ 提交于 2019-12-03 01:45:29
I'm trying to get a list of all ACTIVE instances of my widget. In the OnUpdate method of my AppWidgetProvider, I'm doing the following: // Get all ids ComponentName thisWidget = new ComponentName(context, this.getClass()); int[] lastWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget); The problem is that if you add a widget to your homescreen and then delete it, getAppWidgetIds still returns a list containing among others the id of the widget you just deleted. Is there a way to retrieve the ids of only the widgets that are active on the homescreen? I ran into this as well. I'm guessing

AppWidget image with rounded corners

人走茶凉 提交于 2019-12-02 18:36:27
问题 So, I am dynamically creating an image within my app by animating various Views that I display to the user in the main layout of my application. Currently I am generating my scene within a RelativeLayout, taking the image of the layout as a bitmap, then saving the bitmap to SD to be accessed by the appwidget via uri. This is all working great, but... in an attmept to create rounded corners for the appwidget image, i've tried using these two snippets that I found here. My Problem: is that this

AdapterViewFlipper in app widget: setPendingIntentTemplate() and setOnClickFillInIntent() not working

喜夏-厌秋 提交于 2019-12-02 12:13:06
问题 I am changing a ListView in my app widget to an AdapterViewFlipper. The problem is, I need to handle a click on an item. It worked perfectly to set a pending intent template with setPendingIntentTemplate() to the whole ListView and set a fillInIntent with setOnClickFillInIntent() to each of its items. But now, with AdapterViewFlipper, it doesn't work anymore. Am I missing something? 回答1: You must not call setOnClickFillInIntent() with the id of the item's root view. Use any child view instead

How to know/configure Xamarin Android generated package name?

寵の児 提交于 2019-12-02 11:16:30
问题 I am required to specify full class name (including package name) for the Widget configuration activity like so: <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:configure="my.package.MyConfigActivity" ... > </appwidget-provider> But when I compile my app and look in the generated manifest file, I see that the name of the activity is changed to md52e27f5924a30b693e8c2cbed2aefe779.MyConfigActivity . How do i get this generated name or set it somewhere so

AppWidget image with rounded corners

旧街凉风 提交于 2019-12-02 08:12:59
So, I am dynamically creating an image within my app by animating various Views that I display to the user in the main layout of my application. Currently I am generating my scene within a RelativeLayout, taking the image of the layout as a bitmap, then saving the bitmap to SD to be accessed by the appwidget via uri. This is all working great, but... in an attmept to create rounded corners for the appwidget image, i've tried using these two snippets that I found here. My Problem: is that this method generates a drawable (whose rounded corners look perfect if displayed as a drawable) but I need

Settings Activity Not Launching

断了今生、忘了曾经 提交于 2019-12-02 08:01:43
问题 So far i have coded: public class WidgetActivity extends AppWidgetProvider { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals(action)) { RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_activity); Intent settingsIntent = new Intent(context, Info.class); PendingIntent clickPendIntent = PendingIntent.getActivity (context, 0, settingsIntent, PendingIntent.FLAG_UPDATE

Settings Activity Not Launching

南笙酒味 提交于 2019-12-02 04:08:22
So far i have coded: public class WidgetActivity extends AppWidgetProvider { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals(action)) { RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_activity); Intent settingsIntent = new Intent(context, Info.class); PendingIntent clickPendIntent = PendingIntent.getActivity (context, 0, settingsIntent, PendingIntent.FLAG_UPDATE_CURRENT); views.setOnClickPendingIntent(R.id.Widget, clickPendIntent); AppWidgetManager.getInstance(context)

Remote ListView blinks on android widget

余生颓废 提交于 2019-12-02 03:14:56
I am having an unexpected bothering issue with a remote listview. My app has a simple widget which includes a listview. If the listview has 1 cell height and the listview is at the beginning of its scroll it blinks/flahses everytime datasetchanged is called. The funny thing is that if the listview has more than 1 cell height or if it has 1 cell height BUT it has been scrolled down a bit it doesnt blink. Could anybody please provide some suggestion? I am frustrated. Solutions I have thought so far: 1. Disable loading view (which is what is causing the flash) on the remoteViewFactory. However I