Android examples for Graphics:Color
Prepares a correctly colored ArrayAdapter for a given theme
//package com.java2s; import android.app.ActionBar; import android.app.Activity; import android.widget.ArrayAdapter; public class Main { /**/* w ww .j a v a 2 s . c om*/ * Prepares a correctly colored ArrayAdapter for a given theme * * @param activity * @param items */ public static ArrayAdapter<String> provideNavigationAdapter( Activity activity, String[] items) { 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; } }