Android Manifest Launcher Not Found

若如初见. 提交于 2019-12-02 19:14:52

问题


I changed my Launcher activity to a different activity than the default Activity. But when I am running the Application I am not able to start the application. In the logCat it is saying that the application has been installed but I am not able to see the app in the home screen.

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

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="21" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".Days"
        android:label="@string/app_name" 
        android:theme="@android:style/Theme.Holo" >
        <intent-filter>
            <action android:name="android.intent.action.DAYS" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Holo" >
        <intent-filter>
            <action android:name="com.example.collegehack.MAIN" />

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

</application>

</manifest>

Please tell me where I am going wrong. Thanks in advance.

EDIT Getting the following message in console :

[2015-02-09 02:25:29 - CollegeHack] Android Launch!
[2015-02-09 02:25:29 - CollegeHack] adb is running normally.
[2015-02-09 02:25:29 - CollegeHack] No Launcher activity found!
[2015-02-09 02:25:29 - CollegeHack] The launch will only sync the application package on the device!
[2015-02-09 02:25:29 - CollegeHack] Performing sync
[2015-02-09 02:25:30 - CollegeHack] Automatic Target Mode: Preferred AVD 'Practice' is available on emulator 'emulator-5554'
[2015-02-09 02:25:30 - CollegeHack] Uploading CollegeHack.apk onto device 'emulator-5554'
[2015-02-09 02:25:31 - CollegeHack] Installing CollegeHack.apk...
[2015-02-09 02:25:43 - CollegeHack] Success!
[2015-02-09 02:25:43 - CollegeHack] \CollegeHack\bin\CollegeHack.apk installed on device
[2015-02-09 02:25:43 - CollegeHack] Done!

回答1:


Remove intent filter of Main Activity and put this intent filter to your Days Activity:

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



回答2:


Try adding this to your AndroidMainfest.xml file

 <activity
     android:name=".YourActivityName"> //activty name which you want to launch first
            <intent-filter>//this intent code helps you launch activity when the app starts
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>


来源:https://stackoverflow.com/questions/28399038/android-manifest-launcher-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!