有2个发射活动中的应用 [英] Application with 2 launcher activities

查看:110
本文介绍了有2个发射活动中的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含两个活动

        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>

在清单中。我这样做,以便有在应用程序的抽屉2个独立的条目。它的功能正确地与问候应用程序的抽屉,因为它是。

in the manifest. I did this so that there are 2 separate entries in the app drawer. It functions properly with regards to the app drawer as it is.

我的问题来了在安装过程中。在安装只有一个主/ LAUNCHER活动的应用程序中的最后一页有一个开放的按钮将启动刚安装的应用程序。随着我的应用程序的公开按钮是灰色。我想这是因为它不知道哪两个活动我想它来启动,如果打开按钮,分别为pressed。有什么我可以在清单(或其他地方)设置为指定的活动,我想开按钮启动在安装过程结束?我想一定有什么东西我可以设置,因为当我通过亚行与Eclipse安装应用程序也将启动两项活动之一,幸运的是,它实际上是我想它来启动的。

My question comes during the install. After you install an app with only one MAIN/LAUNCHER activity the last page has an open button that will launch the app that was just installed. With my app this open button is greyed out. I assume it is because it doesn't know which of the two activities I would want it to launch if the open button were pressed. Is there anything I can set in the manifest(or elsewhere) to specify which activity I'd like the open button to launch at the end of the install process? I am thinking there must be something I can set, because when I install the app through adb with eclipse it launches one of the two activities and luckily it is actually the one that I would like it to launch.

推荐答案

这个问题:

<一个href="http://stackoverflow.com/questions/2244781/after-downloading-an-application-with-two-launcher-components-from-the-marketpla">After下载来自卖场2启动组件的应用程序,一下[开启&QUOT;会导致崩溃

帮助我得到它的工作我怎么想。关键是加入:

Helped me to get it working how I wanted. The key was adding:

    <activity-alias android:name="com.android.internal.app.ResolverActivity"
            android:targetActivity=".Main" android:exported="true">
    </activity-alias>

要清单和改变。主要引用您要开始在安装结束后开启按钮的活动。

to the manifest and changing ".Main" to reference the activity that you wish to start with the open button at the end of install.

请注意,该活动别名标签必须声明的的你是指活动标签(在XML)。

Note that the activity-alias tag must be declared after the activity tag you are referring to (in the xml).

这篇关于有2个发射活动中的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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