Intent implicit intent is that no specified component can have more than one
1, first in the mainactivity to establish a button class B,
Then use Setcontentview (R.layout.activity_main) to find the button,
Let B = (Button) setcontentview (R.layout.activity_main);
Add Mouse events for B
B.setonclicklistener (this); To implement the implements Onclicklistener interface at this time
Implementing the OnClick method
The activity to jump must be configured with the appropriate XML file
<activity
Android:name= "Com.example.Intenthaha.Activity_01" >
<intent-filter>
<action android:name= "Com.zxw51.haha"/>
<category android:name= "Android.intent.category.DEFAULT"/>
<data android:scheme= "http" android:host= "www.baidu.com" android:port= "9090" android:path= "/haha"/>
</intent-filter>
</activity>
<intent-filter> for intent filter as long as you match the action name and category name to jump
Data can be set after the URL HTTP protocol for the domain name port number and address need to intent. SetData (Uri. Parse ())
public void OnClick (View v)
{
Definition Intent Intent = new intent ();
Intent.setaction ("Action name string");
Intent.addcategory (Intent.category.DEFAULT);
Intent.setdata (Uri.parse ("Http://www.baidu.com:9090/haha"));
StartActivity (Intent);
}
Intent implicit intent