Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7876505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:10:37+00:00 2026-06-03T03:10:37+00:00

Well this is driving me crazy. I have developed an App-widget. Everything is working

  • 0

Well this is driving me crazy. I have developed an App-widget. Everything is working fine.

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.

The widget has some buttons, one of them launches an activity with about information, the “About Activity”.

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).

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:

startActivity(new Intent(context,act_configure.class).putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, ??? ));

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”

Any help about this will make the hours I spent to find a solution, worth something. Thank you in advance.

p.s. Please forgive my English as they are not my native language…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:10:38+00:00Added an answer on June 3, 2026 at 3:10 am

    How are you setting your widget views? I have an app where I iterate over the active widgets and configure set the RemoteView there. You could set your widget id in the onClick you are attaching to the “About” button.

    final AppWidgetManager widgetManager = AppWidgetManager.getInstance(this);
    final ComponentName widgetName = new ComponentName(this, WidgetProvider.class);
    
    final int[] widgetIds = widgetManager.getAppWidgetIds(widgetName);
    
    for (int widgetId : widgetIds) {
        final RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.widget);
    
        // This is the important part :-D
        remoteViews.findViewById(R.id.your_about_button).setOnClickListener(... a listener to start your about activity that puts the widget id in the extra like you suggest in your question ...);
    
        widgetManager.updateAppWidget(widgetId, remoteViews);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok this is driving me crazy. I have a user account page. Where you
I have a strange problem with sqlite which is driving me crazy. I have
I have a class extends NamedParameterJdbcDaoSupport. well this superclass has a final setDataSource method
I have previously read Spolsky's article on character-encoding, as well as this from dive
This has been driving me nuts for a week now. I have a class
This error has been driving me nuts. We have a server running Apache and
I'm working on a big system, which I have written entirely in Java. But
Okay, this is driving me nuts. I’m working through the IBM CakePHP Tutorial, and
this has been driving me crazy, someone please show me where i screwed it
I'm using .Net 2.0 and this is driving me crazy but there's probably some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.