Is it possible thereotically to create an Android application that contains delete button within itself that deletes the app when pressed?
Asked
Active
Viewed 275 times
2 Answers
2
yes it is you can use:
Uri pkgUri = Uri.parse("package:com.example");
Intent deleteIntent = new Intent(Intent.ACTION_DELETE,pkgUri);
startActivity(deletelIntent);
hope this will help.

Ahmad Sanie
- 3,678
- 2
- 21
- 56
2
You can use this for uninstalling the app
button.setOnClickListener(new View.OnClickListener(){
public void onClick(View view){
Uri packageUri = Uri.parse("package:com.exaample.test");
Intent uninstallIntent =
new Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageUri);
startActivity(uninstallIntent);
}
});
I hope this will help you

Sandeep Singh
- 1,117
- 2
- 11
- 29