Reputation: 6912
I import android.support.v7.app.ActionBarActivity;
to use ActionBar before API 11.
I set ActionBar background as below code after API 11:
getActionBar().setBackgroundDrawable(res.getDrawable(R.drawable.top_bar_bg));
Byt I don't know how to do that before API 11.
How can I do it?
Upvotes: 0
Views: 1665
Reputation: 2090
If you're using the support library you should include getSupportActionBar()
instead of getActionBar()
. So try-
getSupportActionBar().setBackgroundDrawable(res.getDrawable(R.drawable.top_bar_bg));
Upvotes: 5