以编程方式在Android 2.2中启动“添加帐户"活动 [英] Programmatically starting the 'Add Account' activity in Android 2.2

查看:75
本文介绍了以编程方式在Android 2.2中启动“添加帐户"活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去几天,我一直在尝试使用Android SDK,准备为商店编写应用程序,但是遇到了一些问题.

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.

我要编写的应用程序要求用户具有与手机相关联的Google帐户.检索和使用Auth令牌等不是问题,但是我希望能够通过菜单设置->帐户->添加帐户来显示用户可以正常访问的活动.

The App I'll be writing requires that the user has a Google account associated with the phone. Retrieving 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.

现在,通过实验,我已经能够使用以下命令从Shell启动此活动.

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

我无法使用Intent类在JAVA中执行相同的操作.

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

首先有人可以告诉我是否可以通过JAVA进行操作,其次请问我该如何处理?

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?

如果我必须适应同步设置"屏幕,那么我会做到这一点(可以通过Settings.ACTION_SYNC_SETTINGS目的实现),但是很高兴能够将用户直接定向到所需的屏幕.

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.

推荐答案

查看 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆