i followed this tutorial to integrate admob in Android Studio. But now in the MainActivity AdFragment class a few symbols are red (**word* *) (Cannot resolve Symbol) and there is nothing in the error log.
public static class AdFragment extends **Fragment** {
@Override
public **View** onCreateView(**LayoutInflater** inflater, **ViewGroup** container,
Bundle savedInstanceState) {
return inflater.**inflate**(R.layout.fragment_ad, container, false);
}
@Override
public void onActivityCreated(Bundle bundle) {
super.**onActivityCreated**(bundle);
AdView mAdView = (AdView) getView().**findViewById**(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
}
}
Also in the activity_main.xml
<fragment android:name="com.appname.MainActivity$PlaceholderFragment"
PlaceholderFragment is red
No comments:
Post a Comment