How to uninstall a specified application (25) and android 25 together
As follows:
The Code is as follows:
Public class MainActivity extends Activity {private Button btn_delete; @ Overrideprotected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. activity_main); initView ();} private void initView () {btn_delete = (Button) findViewById (R. id. btn_delete); btn_delete.setOnClickListener (new View. onClickListener () {@ Overridepublic void onClick (View v) {String packagen Ame = "com. mobilesafe "; Intent deleteIntent = new Intent (); deleteIntent. setAction (Intent. ACTION_DELETE); deleteIntent. setData (Uri. parse ("package:" + packagename); startActivityForResult (deleteIntent, 0) ;}) ;}@ Overrideprotected void onActivityResult (int requestCode, int resultCode, Intent data) {super. onActivityResult (requestCode, resultCode, data); Toast. makeText (MainActivity. this, "Uninstall successful! ", Toast. LENGTH_LONG );}}
The packagename above indicates the package name of the application You Want To uninstall, that is, the package specified in AndroidManifest. xml.
Reprinted please indicate the source: http://blog.csdn.net/hai_qing_xu_kong/article/details/44263287 sentiment control _