Back to project page Disposable-Apps.
The source code is released under:
GNU Lesser General Public License
If you think the Android project Disposable-Apps listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.pennapps.disposableapps; /*from www. j a v a2 s .c o m*/ import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.widget.Toast; public class UninstallReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Uri packageUri = intent.getParcelableExtra("packageUri"); startUninstallIntent(context, packageUri); Database db = new Database(context); Alarm alarm = db.selectAlarmFromPackageUri(packageUri); db.deleteAlarm(alarm); } private void startUninstallIntent(final Context context, final Uri packageUri) { final Intent uninstallIntent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageUri); uninstallIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(uninstallIntent); } }