Intent: The activity is initiated by startactivity () when the activity is found with the same Intent limit as the set.
Telephone Broadcasting Device:
Intent.setaction ("Android.intent.action.CALL");
Intent.addcategory ("Android.intent.category.DEFAULT");
Intent.setdata (Uri.parse ("Tel:" + strmobile));
StartActivity (Intent)//method will automatically add categories for intent: Android.intent.category.DEFAULT
SMS Transmitter:
Smsmanager manager = Smsmanager.getdefault ();
arraylist<string> texts = Manager.dividemessage (comtent);
for (String text:texts) {
Manager.sendtextmessage (number, NULL, text, NULL, NULL),//4 and 5 parameters are sent SMS status, whether the other party received the message status;
}
Toast.maketext (Getapplicationcontext (), R.string.success,toast.length_long). Show ();
Toast.maketext dialog (Mainactivity.this, Resid, duration);//inner class access external class;
****************************************************************
Findviewbyid (R.id.button);//Find display control based on ID;
View.onclicklistener () {
@Override
public void OnClick (View arg0) {
ARG0 is the object that was clicked
}
}
@+id/button: Within the ID class of the R file, add a constant with the ID button, using the value of the constant as the ID value of the control;
@android: Access to the R file under the Android package;
@id/label: Indicates access to a file with ID label; (relative layout)
Unit test:
Inheriting classes: Androidtestcase
<instrumentation
Android:name= "Android.test.InstrumentationTestRunner"
Android:targetpackage= "Com.hellokity"/>
<application
android:icon= "@drawable/ic_launcher"
Android:label= "@string/app_name" >
<uses-library android:name= "Android.test.runner"/>
</application>
actual = function ();
Assert.assertequals (3,actual), judge whether the actual is 3;