Intent setComponent使用

 使用setComponent來啓動一個activity

 ComponentName con = ComponentName.unflattenFromString("com.android.settings/.SoundSettings");

                Intent localIntent = new Intent("android.intent.action.MAIN");
                localIntent.setComponent(con);
                localIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                        | Intent.FLAG_ACTIVITY_SINGLE_TOP
                        | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
                this.mContext.startActivity(localIntent);
發佈了25 篇原創文章 · 獲贊 1 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章