I'm developing a parental control android app which has the ability to uninstall android apps installed on the mobile phone. I referred answers for the question install / uninstall APKs programmatically (PackageManager vs Intents)
I used the following code to uninstall a specific application.
Intent intent = new Intent(Intent.ACTION_DELETE); intent.setData(Uri.parse("package:com.example.tharindurasanga.locationtracker"));
startActivity(intent);
This code really works fine but not giving what I'm expecting since this is resulting a prompt saying user to confirm the app uninstallation. I need to uninstall the app silently without user confirmation.
Can someone suggest me another method of doing this or help me to remove this prompt. Note: my device has root permissions too