2012-07-11 66 views
0

在我的應用程序中,我開發了一個用戶安裝的第三方應用程序列表。從那裏,現在我想要的是添加一個按鈕,當點擊用戶被引導到內置的應用程序的詳細信息屏幕的強制停止和卸載選項,因爲我只需要用戶安裝的應用程序,我不需要root權限,並作爲以及系統權限。有沒有辦法在我的應用程序中調用系統意圖。在android中使用按鈕單擊卸載應用程序

回答

1

嘗試爲:

Intent detailsIntent = new Intent(); 
    detailsIntent.setClassName("com.android.settings", 
    "com.android.settings.InstalledAppDetails"); 

    //ApiLevel greater than or equal to 8 
    detailsIntent.putExtra("pkg", "Appliction_Package_NAme"); 

    //ApiLevel in less than 8 

    detailsIntent.putExtra("com.android.settings.ApplicationPkgName", 
    "Appliction_Package_NAme"); 

    startActivity(detailsIntent); 
0

試試這個

Intent intent = new Intent(Intent.ACTION_DELETE); 
    intent.setData(Uri.parse("package:app package name")); 
    startActivity(intent); 
相關問題