3

我正在尝试为 Android 开发一个设置向导,因为我想为 Google 现有的功能添加一些功能。是否可以以某种方式与 Android 向导进行交互?因为当我搜索信息时,我发现不使用 Google 的向导可能会导致一些麻烦,比如 gmail 帐户激活等。

如果没有,是否可以在 Google 向导之前或之后立即调用活动?只听 BOOT_COMPLETED 事件就足够了吗?

非常感谢您!

4

2 回答 2

0

I don't know how you will use this unless you are making a rom and can add your app to system but basically you make your setupwizard add-on a Home activity with action MAIN, and categories HOME,DEFAULT. You should also set the priority higher than 1. If any of this is unclear you can look at the Launcher source/manifest that is publicly available.

When your activity is done it should deactivate itself with the PackageManager (setComponentEnabledSetting) and that should be it.

于 2013-03-18T21:20:59.527 回答
0

您可以添加在手机首次启动时启动的其他活动。您只需要模仿与 Google 相同的行为SetupWizardActivity

这是供参考的相关部分AndroidManifest.xml

<activity android:theme="@style/InvisibleNoTitle" android:label="@string/setup_wizard_title" android:name="SetupWizardActivity" android:excludeFromRecents="true" android:launchMode="singleTop" android:immersive="true">
    <intent-filter android:priority="5">
        <action android:name="android.intent.action.MAIN" />
        <action android:name="android.intent.action.DEVICE_INITIALIZATION_WIZARD" />
        <category android:name="android.intent.category.HOME" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

这将允许您在之前/之后运行您的应用程序SetupWizardActivity,具体取决于您的优先级。我相信android:prioirity首先运行的数字更高,但不要引用我的话。

您可以使用apktoolxml找到各种与 Android 相关的 apk的 AndroidManifest 。您甚至可以检查您从 Play 商店或任何其他来源获取的一些 apk。

于 2013-04-28T17:24:23.197 回答