I have problems to find out the correct launcher icon size for my shortcut.
On my Nexus 7.2 the value of android.R.dimen.app_icon_size (see code) is 96 pixels. But if I
I have found out a working solution:
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private int launcherLargeIconSize() {
ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
return activityManager.getLauncherLargeIconSize();
}
int size1 = (int) getResources().getDimension(android.R.dimen.app_icon_size);
int size2 = Build.VERSION.SDK_INT >= 11 ? launcherLargeIconSize() : 0;
int size = size2 > size1 ? size2 : size1;