start com.android.settings/com.android.settings.SubSettings activity

来源:互联网 发布:如何选笔记本电脑 知乎 编辑:程序博客网 时间:2024/05/29 09:47

1. get class name:

adb shell

shell@android:/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);


0 0