Code example for ColorDrawable

Methods: setBackgroundDrawable

0
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) {
            getActionBar().setBackgroundDrawable(new ColorDrawable(Color.GRAY));
            // Note: if you use ActionBarSherlock use here getSupportActionBar() 
        } 
 
        setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, options));
 
        getListView().setBackgroundColor(0xFF404040);
    } 
 
    @Override 
    protected void onListItemClick(ListView listView, View view, int position, long id) {
        Intent intent;
 
        switch (position) {
            default: 
            case 0: