1. Are you ready for the Galaxy S20? Here is everything we know so far!

How to manage multi activity?

Discussion in 'Android Development' started by levanphong7887, May 25, 2011.

  1. levanphong7887

    Thread Starter

    Hi all,

    I'm new android developer.
    My program has 3 Activities: Activity_A, Activity_B and Activity_C
    each Activity I overide onCreate() method.
    I want when the program is started, Activity_C will display first.
    How to do it?
    And how to know which Activity will be display first?
    Sometime I get a runtimeException from this program?
    Please explain to me,
    Many thanks !

    Content of my mainfest.xml file:
    Code (Text):
    1.  
    2. <?xml version="1.0" encoding="utf-8"?>
    3. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    4.       package="i3.customview"
    5.       android:versionCode="1"
    6.       android:versionName="1.0">
    7.     <uses-sdk android:minSdkVersion="8" />
    8.  
    9.     <application android:icon="@drawable/icon" android:label="@string/app_name">
    10.    
    11.            <activity android:name=".Activity_A"
    12.                   android:label="@string/app_name">
    13.                  <intent-filter>
    14.                 <action android:name="android.intent.action.MAIN" />
    15.                 <category android:name="android.intent.category.LAUNCHER" />
    16.             </intent-filter>
    17.         </activity>
    18.        
    19.         <activity android:name=".Activity_B"
    20.                   android:label="@string/app_name">
    21.                  <intent-filter>
    22.                 <action android:name="android.intent.action.MAIN" />
    23.                 <category android:name="android.intent.category.LAUNCHER" />
    24.             </intent-filter>
    25.         </activity>
    26.        
    27.         <activity android:name=".Activity_C"
    28.                   android:label="@string/app_name">
    29.                  <intent-filter>
    30.                 <action android:name="android.intent.action.MAIN" />
    31.                 <category android:name="android.intent.category.LAUNCHER" />
    32.             </intent-filter>
    33.         </activity>
    34.        
    35.     </application>
    36.      <uses-permission android:name="android.permission.INTERNET" />
    37. </manifest>
    38.  
     



    1. Download the Forums for Android™ app!


      Download

       
  2. uaeHamed

    uaeHamed Newbie

    "<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    "
    I think this means the activity is the main activity and it has an icon in the launcher. So you need to keep this only on Activity_C and remove it from the other activities.
     
    levanphong7887 likes this.
Loading...

Share This Page

Loading...