Hi,

I'm developing a widget with a configuration activity. This activity
is launched correctly where the widget is installed (at first time),
but not the other times when I click on the widget at home screen.

I have debugged the code and I see that the appWidgetId is not valid
(0 value).

The code in the configuration activity which is needed to do this (in
theory) and I write in it:
                                ....
                                Intent resultValue = new Intent();
                                
resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
                                                appWidgetId);
                                setResult(RESULT_OK, resultValue);
                                finish();

And in my widget class (AppWidgetProvider extends):
                ....
                Intent settingsIntent = new Intent(context,
SettingsActivity.class);
                settingsIntent
                                
.setAction(android.appwidget.AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
                PendingIntent settingsPendingIntent = PendingIntent.getActivity(
                                context, 0, settingsIntent, 0);

                RemoteViews remoteViews = new 
RemoteViews(context.getPackageName(),
                                R.layout.widget);
                remoteViews.setTextViewText(R.id.eur_value, data.getValue());

                remoteViews.setTextViewText(R.id.value, value);
                remoteViews.setOnClickPendingIntent(R.id.widget,
settingsPendingIntent);

                ComponentName thisWidget = new ComponentName(context,
                                MyWidget.class);
                appWidgetManager.updateAppWidget(thisWidget, remoteViews);

Somebody have any idea?

Thanks for all

See you,
SBC
http://desbc.blogspot.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to