I would like to show/hide the action bar upon a click.
It does show and hide but it is not smooth…the bottom part hides but a different background for a little while before disappearing.
I even tried it in a simple hello world app and the result is the same.
Here’s the code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView tv = (TextView) findViewById(R.id.shit);
tv.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
getActionBar().hide();
}
});
}
Use overlay mode instead of showing and hiding the actionbar.
From the actionbar documentation: