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