簡體   English   中英

Android應用程序未在啟動器中顯示

[英]Android App do not show in launcher

我是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文件移動到具有Android v5.1.1 lolipop的三星銀河j2並安裝時,它會成功安裝, 但沒有打開選項,甚至不會出現在應用程序抽屜中 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>

您需要使用這樣的意圖過濾器在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>

更新清單

<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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM