views:

47

answers:

1

I've been experimenting with the Android SDK over the past few days, in readiness to write an App for the store, however I've run across a bit of a problem.

The App I'll be writing requires that the user has a Google account associated with the phone. Retreiving and making use of the Auth token etc was not a problem, however I would like to be able to show the activity that a user would normal reach by going through the menus Settings->Accounts->Add Account.

Now through experimentation I've been able to launch this activity from the shell using the following command.

am start -n com.google.android.gsf/.login.AccountIntroActivity

I'm having trouble performing the same action in JAVA using the Intent class.

Would anyone be able to tell me firstly whether or not this can be done via JAVA, and secondly how I could go about it please?

If I have to settle for the Sync Settings screen then I will (this can be achieved through the Settings.ACTION_SYNC_SETTINGS intent), however it'd be quite nice to be able to direct the user straight to the required screen.

Thanks!

A: 

Check out the ACTION_ADD_ACCOUNT

startActivity(new Intent(Settings.ACTION_ADD_ACCOUNT));
Pentium10
My thanks - that is one step closer to what I'm trying to achieve, however to quote our Jedi masters - 'this is not the Activity you are looking for'.It is the next step in the chain I am trying to invoke - part of the Setup Wizard - the activity that appears when you click on the 'Google' account symbol. If this is impossible, I'll stick with the ACTION_ADD_ACCOUNT answer. Thanks
Seidr
Probably it's impossible because I don't see on the linked resource. And that is the only page that describes the settings globals.
Pentium10
That's what I feared - I imagine access to the component I'm calling above from adb shell (com.google.android.gsf/.login.AccountIntroActivity) is probably restricted some how.
Seidr