Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <android.support.design.widget.AppBarLayout
  2. android:layout_width="match_parent"
  3. android:layout_height="wrap_content"
  4. android:theme="@style/AppTheme.AppBarOverlay">
  5. <android.support.v7.widget.Toolbar
  6. android:id="@+id/toolbar"
  7. android:layout_width="match_parent"
  8. android:layout_height="?attr/actionBarSize"
  9. android:background="#FFFFFF"
  10. app:popupTheme="@style/AppTheme.PopupOverlay">
  11. </android.support.v7.widget.Toolbar>
  12. </android.support.design.widget.AppBarLayout>
  13.  
  14. setSupportActionBar(toolbar);
  15.  
  16. Override
  17. public boolean onCreateOptionsMenu(Menu menu) {
  18. // Inflate the menu; this adds items to the action bar if it is present.
  19. getMenuInflater().inflate(R.menu.menu_main, menu);
  20. return true;
  21. }
  22.  
  23. @Override
  24. public boolean onOptionsItemSelected(MenuItem item) {
  25. // Handle action bar item clicks here. The action bar will
  26. // automatically handle clicks on the Home/Up button, so long
  27. // as you specify a parent activity in AndroidManifest.xml.
  28. int id = item.getItemId();
  29.  
  30. //noinspection SimplifiableIfStatement
  31. if (id == R.id.action_settings) {
  32. return true;
  33. }
  34.  
  35. return super.onOptionsItemSelected(item);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement