On android pie, I want to call the package manager to uninstall my own app. Here is what I am trying:
val uri = Uri.parse("package:$packageName")
val uIntent = Intent(Intent.ACTION_UNINSTALL_PACKAGE, uri)
startActivity(uIntent)
Oddly this is not working. Nothing is being shown in the logcat as well.
I have also tried ACTION_DELETE
val uri = Uri.parse("package:$packageName")
val uIntent = Intent(Intent.ACTION_DELETE, uri)
startActivity(uIntent)
Please tell me what I am doing wrong. This seems a pretty straightforward job. Am I missing any permission or something I need to declare in manifest? Thanks.