【问题标题】:When I install my apk I get an icon for every class in the project当我安装我的 apk 时,我会为项目中的每个类获得一个图标
【发布时间】:2010-10-10 10:20:19
【问题描述】:

我在 Eclipse 中有一个项目,可能有 7 个不同的类,我用 Intent 打开。问题是当我在我的 HTC 手机上安装 .apk 时,我会为每个班级获得一个图标。如何制作项目,使其仅作为一个应用程序安装? /约翰·安德森

【问题讨论】:

    标签: android eclipse apk


    【解决方案1】:

    确切地说,正如 mreichelt 所说,您必须从清单上声明的每个类中删除这一行,除了您想成为主要活动的类:D

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

    【讨论】:

    • 感谢一百万!它就像一个魅力。现在我明天可以用一个新应用给老板留下深刻印象:)
    【解决方案2】:

    如果您只想从启动器启动一项活动,只需在清单中删除所有其他活动的意图过滤器即可。在这里阅读更多:http://developer.android.com/guide/topics/fundamentals.html#ifilters

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-26
      • 1970-01-01
      • 2022-11-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多