Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Types of Activity launch mode

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 171
    Comment on it

    Basically activity have a default launch mode that is Standard launch mode but we can change launch mode according to our need.
    There are four types of launch mode avaiable that are :
    1.Standard
    2.SingleTop
    3.SingleTask
    4.SingleInstance


    Standard - This is by default launch mode of an activity that multiple instances of an activity can be created.

    SingleTop - This mode is slight different from Standard mode because if an instance of activity already at top of the history stack, no new instance will be created at this point because it will fire off an onNewIntent() method instead of creating a new object.

    <activity android:name=".SingleActivity" android:launchMode="singleTop">
    <intent-filter>
    <action android:name="android.intent.action.VIEW"></action>
    <category android:name="android.intent.category.DEFAULT"></category>
    <category android:name="android.intent.category.BROWSABLE"></category>
    <data android:scheme="oauth" android:host="twitt"></data>
    </intent-filter>
    </activity>
    

    SingleTask - This mode is quite different from standard and singleTop. An Activity with singleTask launchMode is allowed to have only one instance in the system like a singleton class.

    SingleInstance - This mode allowed to have only single instance of an activity so this is almost similar to SingleTask launch mode.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: