Use of Toolbar



  • I put Toolbar and made a button of Nazad. I don't know how to put a processor on her.

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    if (toolbar != null) {
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    


  • Click processing. onOptionsItemSelected(Menu menu) which can be redesigned and borrowed from the component to which the user has clicked can be easily processed.

    If what id buttons back, if it's not castom, which can be seen in your code, it will be. android.R.id.homeif you didn't exactly point it out, please correct it.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2