List of usage examples for android.app PendingIntent getCreatorPackage
@Nullable
public String getCreatorPackage()
From source file:Main.java
/** * @see android.app.PendingIntent#getCreatorPackage() *///from w w w .j ava2 s .c o m @SuppressWarnings("deprecation") public static String getCreatorPackage(PendingIntent intent) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return intent.getCreatorPackage(); } else { return intent.getTargetPackage(); } }
From source file:android.support.customtabs.browseractions.BrowserActionsIntent.java
/** * Get the package name of the creator application. * @param intent The {@link BrowserActionsIntent}. * @return The creator package name.// w ww . ja va 2 s . c o m */ @SuppressWarnings("deprecation") public static String getCreatorPackageName(Intent intent) { PendingIntent pendingIntent = intent.getParcelableExtra(BrowserActionsIntent.EXTRA_APP_ID); if (pendingIntent != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return pendingIntent.getCreatorPackage(); } else { return pendingIntent.getTargetPackage(); } } return null; }