1. componentname
This class is mainly used to obtain the activity name of the package name and forward it to this activity.
Ntent. setcomponent (componetname );
Startactivity (intent );
2. startactivities (intent [])
Startactivities (buildintentstoviewslists ());
We often use startactivity (intent), while startactivities (intent []) play the same role as startactivities,
It is nothing more than adding the jump target activity pointed to by the three intent [] to the current activity stack in sequence from the back to the front, if you use the "back" key after clicking the button,
The returned sequence is the same as that in intent [] From the back to the front.
3. Remove the title bar
Requestwindowfeature (window. feature_no_title); // remove the title bar.
// Cancel the status bar
This. getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen,
Windowmanager. layoutparams. flag_fullscreen );
4. Color textview directly with the color value
Color. parsecolor ("ffffff)
TV. settextcolor (color. RGB (255,255,255 ));
Settextcolor (0xff737373 );
5. threads
The interrupt () method can interrupt the thread that is being executed. If the thread is sleep () at this time, an error will be reported.
6. Press back to return to the desktop without exiting the program
Intent home = new intent (intent. action_main );
Home. setflags (intent. flag_activity_clear_top );
Home. addcategory (intent. category_home );
Startactivity (home );
7. install an APK on the SDK
public void installApk(File file) {Uri uri = Uri.fromFile(file);Intent intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(uri, "application/vnd.android.package-archive");startActivity(intent);}
8. display text of different colors in segments in textview text
Edittext2.settext (HTML. fromhtml ("<font color = # e61a6b> red code </font>" + "<I> <font color = # 1111ee> blue italic Code </font> </I>" + "<u> <I> <font color = # 1111ee> blue italic and bold underline Code </font> </I> </u> "));
Unfortunately, HTML classes do not support font size setting.