Android-activate activity via intent

Source: Internet
Author: User

start activity with intent


This address: Http://blog.csdn.net/caroline_wendy


To dynamically correlate the activity interface , use intent to start . flexibility to bind .
In the intent static class . Define the contents of the intent:

public static final String action_home = "Me.cxxxyx.CxxxyxIntent.ACTION_HOME";

the startactivity (intent) other activity is then initiated via intent:
Intent Intent = new Intent (); intent.setaction (cxxxyxintent.action_home); startactivity (Intent);

you need to register the corresponding filter in the androidmanifest :
        <activity            android:name= "me.cxxxyx.hwdxxxxx.HomePageActivity"            android:screenorientation= "Portrait"            android:launchmode= "Singletask"            android:theme= "@style/cxxxyxhw.activity" >            <intent-filter >                <action android:name= "Me.cxxxyx.CxxxyxIntent.ACTION_HOME"/>                <category android:name= " Android.intent.category.DEFAULT "/>            </intent-filter>            <intent-filter>                <action Android:name= "Android.intent.action.VIEW"/>                <category android:name= "Android.intent.category.DEFAULT" />                <data                    android:scheme= "Cxxxyx"                    android:host= "launch"                    android:pathpattern= "Home"/ >            </intent-filter>        </activity>

It is able to jump interface (Activity).







Android-activate activity via intent

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.