[Solved] Error:(106, 20) error: method onCreate(Bundle) is already defined in class MainActivity


The part I’m trying to add

You should be adding this part into the existing onCreate method, not the entire method body

// Load an ad into the AdMob banner view.
AdView adView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
        .setRequestAgent("android_studio:ad_template").build();
adView.loadAd(adRequest);

// Toasts the test ad message on the screen. Remove this after defining your own ad unit ID.
Toast.makeText(this, TOAST_TEXT, Toast.LENGTH_LONG).show();

0

solved Error:(106, 20) error: method onCreate(Bundle) is already defined in class MainActivity