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 6750057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:45:48+00:00 2026-05-26T12:45:48+00:00

i want to create a widget app that when added will start ConfigurationActivity which

  • 0

i want to create a widget app that when added will start ConfigurationActivity which has some options to choose.

Then, you can click on the Next button to go to the NextActivity and configure each individual option you chose on the first screen.

Then, click Finish button and return to the home screen with the widget on it now.

Can this be done from the configuration activity that I define in my XML, or do I have to maybe do a startActivity in the onEnabled() and have then update my widget that way?

Thank you for any help.

  • 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-05-26T12:45:48+00:00Added an answer on May 26, 2026 at 12:45 pm

    You can totally do this from the configuration activity that you define in your xml. Just make your first activity start an intent that goes to your second activity, but use the startActivityForResult() method. Then in your second activity, make it so when the user clicks the Finish button in the second activity, that the second activity calls the finish() method. But before you call finish, set the result to all the data you’ve collected in this second activity. Control will then return to the first activity where you can handle the results you got from the second activity in your onActivityResult() method. Then just add the results from the second activity to the results that you’re going to return from this activity.

    Alright, so let’s look at a barebones example of this.

    ConfigActivity1 extends Activity{
    
      protected onCreate(Bundle icicle){
        //do your setup stuff here.
    
        //This is the button that's going to take us to the next Config activity.
        final Button nextConfig = (Button)findViewById(R.id.next_config);
        //We'll add an onClickListener to take us to the second config activity
        nextConfig.setOnClickListener(new View.OnClickListener(){
          public void onClick(View view){
            //Construct Intent to launch second activity
            Intent furtherConfigIntent = new Intent(ConfigActivity1.this, ConfigActivity2.class);
            //By using startActivityForResult, when the second activity finishes it will return to
            //this activity with the results of that activity.
            startActivityForResult(furtherConfigIntent, 0);
          }
        });
        //finish any other setup in onCreate
      }
    
      //This is a callback that will get called when returning from any activity we started with the
      //startActivityForResult method
      protected void onActivityResult(int requestCode, int resultCode, Intent data){
        if(resultCode == Activity.RESULT_CANCELED){
          //this means the second activity wasn't successfull we should probably just 
          //return from this method and let the user keep configuring.
          return;
        }
        //ok, if we made it here, then everything went well in the second activity.
        //Now extract the data from the data Intent, compile it with the results from this
        //acitivity, and return them. Let's say you put them in an Intent called resultsIntent.
        setResult(Activity.RESULTS_OK, resultsIntent);
        finish();
      }
    
    
    }
    

    The second acitvity will be pretty straightforward. Just collect your config data, and when the user presses finish, set the result data and the resultCode to OK, and then finish.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application, which has a Spinner that I want populated with some
I want to create a splash screen that will then move to the login/register
I want to create a tab/widget/thingymajiggy like the feedback-thing in this picture: That behaves
I want to create a Settings-Widget, where I can choose a Date. Because it
I want to create an app, where the user will decide it the main
I want to create a component that will appear as a navigation menu for
I am trying to create an application that has a background image with widget
I have some external Javascript files in my GWT app that I only want
We want to create a widget platform for a particular website. I couldn't find
I am having an issue with PyQt4. I want to create a new widget

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.