This is how I do it. I would use it sparingly though so you don't bind
your app to a particular phone. I really only use it to determine
whether or not I should be showing light or dark icons in the
notification bar. This seems to work fine with my HTC Incredible and
the emulator to determine whether it is there or not. Of course I
don't have two home screens installed on my incredible so I don't know
what would happen in that case.
Hope this helps,
David
private static final String SENSE_UI_LAUNCHER_NAME =
"com.htc.launcher.Launcher";
private static Boolean senseUI;
public static final boolean isSenseUI(Context context) {
if (senseUI == null) {
senseUI = false;
PackageManager packageManager =
context.getPackageManager();
Intent intent = new
Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
List<ResolveInfo> list =
packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
for (ResolveInfo info : list) {
if (info.activityInfo != null &&
SENSE_UI_LAUNCHER_NAME.equals(info.activityInfo.name)) {
senseUI = true;
break;
}
}
}
return senseUI;
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en