After i changing activity in my nav header, i have strange flickers and i want to get rid of them:
Im not sure which part of code should i show, but guess that problem could be in how intents are creating or something like that. Here is a code of my navigation buttons:
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.main) {
Intent main = new Intent(main.this, main.class);
main.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(main);
} else if (id == R.id.find_friends) {
Intent findfriends = new Intent(main.this, FindFriends.class);
findfriends.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(findfriends);
} else if (id == R.id.followers) {
Intent followers = new Intent(main.this, Followers.class);
followers.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(followers);
} else if (id == R.id.follow) {
Intent follow = new Intent(main.this, Follow.class);
follow.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(follow);
} else if (id == R.id.statistics) {
Intent statistic = new Intent(main.this, statistic.class);
statistic.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(statistic);
} else if (id == R.id.LogOut) {
FirebaseAuth.getInstance().signOut();
Intent mainact = new Intent(main.this, MainActivity.class);
mainact.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(mainact);
} else if (id == R.id.About) {
Intent about = new Intent(main.this, About.class);
about.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(about);
}
DrawerLayout drawer = findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}