Android Utililty Methods Activity Get

List of utility methods to do Activity Get

Description

The list of methods to do Activity Get are organized into topic(s).

Method

ArrayAdapterprovideNavigationAdapter( Activity activity, String[] items)
Prepares a correctly colored ArrayAdapter for a given theme
ActionBar actionBar = activity.getActionBar();
if (actionBar != null) {
    return new ArrayAdapter<String>(
            actionBar.getThemedContext() != null ? actionBar.getThemedContext()
                    : activity,
            android.R.layout.simple_list_item_1, items);
return null;
...
DrawablegetThemeUpIndicator(Object info, Activity activity)
get Theme Up Indicator
final TypedArray a = activity.obtainStyledAttributes(THEME_ATTRS);
final Drawable result = a.getDrawable(0);
a.recycle();
return result;
DrawablegetThemeUpIndicator(Object info, Activity activity)
get Theme Up Indicator
final TypedArray a = activity.obtainStyledAttributes(THEME_ATTRS);
final Drawable result = a.getDrawable(0);
a.recycle();
return result;
StringgetActivityMetaData(Activity activity, String key)
get Activity Meta Data
String data = null;
ActivityInfo info = null;
try {
    info = activity.getPackageManager().getActivityInfo(
            activity.getComponentName(),
            PackageManager.GET_META_DATA);
} catch (NameNotFoundException e) {
    e.printStackTrace();
...
StringgetFirstActivityName(Context context, String pkg)
get First Activity Name
String activityName = null;
List<PackageInfo> list = context.getPackageManager()
        .getInstalledPackages(PackageManager.GET_ACTIVITIES);
int length = list.size();
Log.d("pkg length", length + "");
for (int i = 0; i < length; i++) {
    String name = list.get(i).packageName;
    Log.d("pkg " + i, name);
...
booleanisSingleFragmentIntent(Activity activity)
is Single Fragment Intent
Bundle param = activity.getIntent().getBundleExtra(
        SINGLE_FRAGMENT_ACTIVITY_START_ME_PARAM);
return param != null;