Notification details dialog
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
package net.headlezz.notificationlogger;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
@@ -49,5 +52,21 @@ public class PackageUtils {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param packageName
|
||||
* @return true if application settings opened successful
|
||||
*/
|
||||
public static boolean showAppInfoActivity(Context context, String packageName) {
|
||||
try {
|
||||
Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
intent.setData(Uri.parse("package:" + packageName));
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
||||
context.startActivity(intent);
|
||||
return true;
|
||||
} catch ( ActivityNotFoundException e ) {
|
||||
Timber.e("Failed to open app info", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user