java - 当我运行项目时,我的应用程序未显示在模拟器上

标签 java android android-emulator

当我尝试运行该项目时,它会在模拟器上成功安装,但模拟器不会在其应用程序菜单中显示我的应用程序启动器图标。但它在设置>应用程序>管理应用程序>所有应用程序中的已安装应用程序中显示我的应用程序,这意味着应用程序已安装。但它没有运行。

list :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.thenewboston.travis"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="16" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".Splash"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.thenewboston.travis.SPLASH" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name=".Main"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.thenewboston.travis.MAIN" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".Menu"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.thenewboston.travis.MENU" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    </application>

     </manifest>

最佳答案

确保您的启动 Activity 在 list 中正确声明了其 Intent 过滤器,以便在启动器中显示。

假设您希望“Splash”成为您的主要 Activity ,请将其声明更改为此(特别是 Intent 过滤器操作)

 <activity
            android:name=".Splash"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
 </activity>

您的 Intent 过滤器操作不是 Android 默认值的一部分(以及启动器通常寻找的内容)。只有旨在查找“com.thenewboston.travis.SPLASH”操作的启动器才会看到您的 Activity

关于java - 当我运行项目时,我的应用程序未显示在模拟器上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13846608/

相关文章:

java - JDBC分页: vendor specific sql versus result set fetchSize

java - 这段示例代码中哪里发生了回溯?

Android HttpURLConnection POST 给出 HTTP 错误 411

android - 模拟器卡住 : Revoking microphone permissions for Google App

java - 最佳实践 : Map object properties from string collection

java - 使用 IP 的有效 Android 证书

android - 使用 DialogFragment 作为 Android NavController 中的 fragment 之一

java - 在 Java 中向 Firebase 中的特定主题发送通知

android - 10.0.2.2 :8080 in web browser in emulator is not working

java - runOnUiThread 方法和 Handler 有什么区别?哪一个最好用?