1. Get class Name:
ADB shell
[Email protected]:/mnt/sdcard/books $ dumpsys window Windows >dump.txt
grep "Focus"
Mfocusedapp=appwindowtoken{420a5df8 token=token{420a5c00 Activityrecord{420a5ac8 com.android.settings/. Subsettings}}}
minputmethodtarget=window{420fc320 com.android.settings/com.android.settings.subsettings Paused=false}
Or
adb shell "Dumpsys window Windows | Grep-e ' Mcurrentfocus|mfocusedapp ' "
Http://stackoverflow.com/questions/11201659/whats-android-adb-shell-dumpsys-tool-and-its-benefits
Http://www.cnblogs.com/jiangz/p/3330245.html
2. Start activity
Intent intent=new Intent ("/");
ComponentName cn=new componentname ("Com.android.settings", "com.android.settings.profile.ProfileSettings");
ComponentName cn=new componentname ("Com.android.settings", ". Profile". Profilesettings ");
Intent.setcomponent (CN);
Startactivityforresult (Intent, 1);
Start com.android.settings/com.android.settings.subsettings activity