Guest User

Untitled

a guest
Dec 10th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. @Override
  2. protected void onCreate(Bundle savedInstanceState) {
  3. super.onCreate(savedInstanceState);
  4. setContentView(R.layout.activity_main);
  5. Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  6. setSupportActionBar(toolbar);
  7.  
  8.  
  9.  
  10. DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
  11. ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
  12. this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
  13. drawer.addDrawerListener(toggle);
  14. toggle.syncState();
  15.  
  16. NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
  17. navigationView.setNavigationItemSelectedListener(this);
  18. }
  19.  
  20. @Override
  21. protected void onCreate(Bundle savedInstanceState) {
  22. super.onCreate(savedInstanceState);
  23. setContentView(R.layout.activity_main);
  24.  
  25. // Load an ad into the AdMob banner view.
  26. AdView adView = (AdView) findViewById(R.id.adView);
  27. AdRequest adRequest = new AdRequest.Builder()
  28. .setRequestAgent("android_studio:ad_template").build();
  29. adView.loadAd(adRequest);
  30.  
  31. // Toasts the test ad message on the screen. Remove this after defining your own ad unit ID.
  32. Toast.makeText(this, TOAST_TEXT, Toast.LENGTH_LONG).show();
  33. }
Add Comment
Please, Sign In to add comment