title: how to set backspace button in place ActionbarDrawerToggle to navigate to previous fragments?
body: <p>I am calling fragments from Main_activity.java and also calling fragments from other fragments but i want to show backspace(&lt;-) arrow button when any fragment is loaded(either from Main_activity or any other fragments) instead of ActionBarDrawerToggle. how can I achieve this?
  Main Activity code</p>
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  NavigationView nav;
  ActionBarDrawerToggle toggle;
  DrawerLayout drawerLayout;
  Toolbar toolbar;
  ImageView homeInToolbar;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      toolbar=findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);
  
      nav=findViewById(R.id.navigationview);
      drawerLayout=findViewById(R.id.drawer);
     // homeInToolbar=findViewById(R.id.homeInToolbar);
  
      toggle=new ActionBarDrawerToggle(this,drawerLayout,toolbar,R.string.open,R.string.close);
      drawerLayout.addDrawerListener(toggle);
      toggle.syncState();
      FragmentManager manager=getSupportFragmentManager();
      nav.setCheckedItem(R.id.menu_home);
  
  
      FragmentTransaction transaction=manager.beginTransaction();
      manager.beginTransaction().replace(R.id.framelayout,new HomeFragment()).commit();}
  </code></pre>
  <p><a href="https://i.stack.imgur.com/ih2yr.png" rel="nofollow noreferrer">Main_Activity where the toogle is shown and after click on students, the image should look like</a></p>