Reputation: 13
I have a function updateActionBar to change the action's bar background. When the app starts, this function change the background :
getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.header_bacjground_test));
THe scenario is : the app moves to new activity and that activity finishes by calling finish() function( the app returns to the main acivity), setBackgroundDrawable doesnt work even it is called. The background is set to black while the expected background is gray.
Upvotes: 1
Views: 1310
Reputation: 10622
In Activity file, override onStart() method and write
getSupportActionBar().setBackgroundDrawable(
getResources().getDrawable(R.drawable.header_background_test));
Whenever you move activity to front or back, the header will remain same backgorund
Upvotes: 1