Android App不会在启动器中显示

时间:2017-01-12 11:29:06

标签: android android-manifest

我是一个完整的Android编程新手,我在一个有以下源代码的应用程序:

    <LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:background="#FFFFFF"
    android:orientation="vertical"
    >
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Guest"
        android:textColor="#FFF"
        android:background="#FF697A"
        android:textSize="70sp"/>
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Shivam Jha"
        android:background="#FF414D"
        android:textColor="#FFFFFF"
        android:textSize="40sp"/>

 <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Prabhakar"
        android:textColor="#FFFFFF"
        android:background="#FF414D"
        android:textSize="40sp"/>
    <ImageView
       android:layout_width="match_parent"
       android:layout_height="280dp"
       android:src="@mipmap/patio"/>

<TextView
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:text="Google Office Front (USA)"
    android:background="#999999"/>
</LinearLayout>

当我修复此应用程序时,将生成的apk文件移动到我的三星galaxy j2 使用android v5.1.1 lolipop,并安装它,它将成功安装 但没有打开选项,甚至不会出现在应用程序抽屉 。 Pleasse帮我一样.. 注意:我确定Android版本没有任何问题!!!

这是我的清单文件

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.shivamjha.anonymous">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

    </application>

</manifest>

2 个答案:

答案 0 :(得分:0)

您需要在AndroidManifest.xml中使用这样的意图过滤器定义活动。

 <activity
        android:name=".activities.MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

    </activity>

答案 1 :(得分:0)

更新您的清单

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.activities">

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <activity
    android:name=".activities.MainActivity">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

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

</application>