Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
in my android application i have two activities.
i want to use intent filter to set default launcher activity,but it invoke always my first created activity.
my Manifest.xml code is like this:

HTML
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    package="com.example.app1"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk>
        android:minSdkVersion="10"
        android:targetSdkVersion="19" />

    <application>
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        
        <activity>
            android:name=".MainActivity"
            android:label="@string/app_name" >
            
        </activity>
        
       <activity>
            android:name=".NewLayoutActivity"
            android:label="@string/title_activity_new_layout" >
           <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity> 
    </application>

whats wrong in it.
please help.
thanks.
Posted
Updated 25-Aug-15 1:20am
v2
Comments
Richard MacCutchan 25-Aug-15 7:24am    
Check that this manifest has been correctly copied to your bin directory. You may also need to clean and rebuild the project.
ruby kaur 1-Sep-15 2:30am    
both manifest are identical,i clean and rebuild the project but stillits not working.
Richard MacCutchan 1-Sep-15 2:44am    
Try re-ordering the activities so that NewLayoutActivity appears first in the manifest file. Alternatively rework your code so the correct classes and methods are in your main activity. For further information on intent filters see http://developer.android.com/guide/components/intents-filters.html.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900