Is it posible to eliminate the actionbar seen on the "recent apps" screen? My theme in the manifest is Theme.AppCompat.Light.NoActionBar and everything is good in my app screen... it looks like this:activity screen
But when i switch to the "recent apps" screen in the phone, it looks like this: app manager screen
I tried to customize in java code, but when i call getActionBar() or getSupportActionBar(), it returns null, and i guess is because im using a noactionbar theme.
I don't think it is possible to remove the AppBar under app manager screen but you can certainly change the color of it.
Android will use <item name="colorPrimary">@color/colorPrimary</item>
in your App Theme to select the color of AppBar under app manager screen or you can say header color.
You can either change that <item name="colorPrimary">
@color/colorPrimary</item>
to your desired color that you want but it will impact your whole app because android will use that primaryColor on many different places in your app.
An other option you have is to set that header color in your code using TaskDescription class. Code will be as follows -
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Bitmap bitmapIcon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
ActivityManager.TaskDescription taskDescription =
new ActivityManager.TaskDescription(getString(R.string.app_name), bitmapIcon, getColor(R.color.colorHeaderColor));
this.setTaskDescription(taskDescription);
// more code here........
}
}
Value of R.color.colorHeaderColor
can be desired color. Result will be as follows -
Happy Coding !