Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Launch an Android AppWidget's configuration Activity from another activity?
    text
    copied!<p>Well this is driving me crazy. I have developed an App-widget. Everything is working fine.</p> <p>I have a configuration activity which launches every time a widget is added on the home screen and works beautiful. I save the user settings per widget id etc.</p> <p>The widget has some buttons, one of them launches an activity with about information, the "About Activity".</p> <p>The "About Activity" has a button which I want to use to launch the configuration activity for the widget id that launched the "About Activity". The reason I want to do that is because I want the user to be able to configure the contents of any instance of my widget without having it removed and added again (in order to launch the configuration activity).</p> <p>The configuration activity needs the AppWidgetManager.EXTRA_APPWIDGET_ID in order to make the job (save the user settings for this specific widgetid) so I must somehow pass this extra when I 'm calling it from another activity. The obvious think to do is this:</p> <pre><code>startActivity(new Intent(context,act_configure.class).putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, ??? )); </code></pre> <p>Now my question is where is the widgetid? I found a million ways to get the widgetids (the array) but not a single clue on how to get the specific widgetid which launched the "About Activity"</p> <p>Any help about this will make the hours I spent to find a solution, worth something. Thank you in advance.</p> <p>p.s. Please forgive my English as they are not my native language... </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload