i´m working on a Tutorial right now and i´m creating a Android Drawer.
Java - Files:
- MainActivity
- NavigationDrawerFragment
- AboutMeFragment
- ContactInfoFragment
- MyCompanyFragment
XML- Files:
-activity_main
-fragment_about_me
-fragment_contact_info
-fragment_my_company
fragment_navigation_drawer
- fragment_main
The three Files "AboutMeFragment, ContactInfoFragment, MyCompanyFragment contain alomost the same code.
package blabla.app1;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class AboutMeFragment extends Fragment {
public static AboutMeFragment newInstance(){
AboutMeFragment fragment = new AboutMeFragment();
return fragment;
}
public AboutMeFragment(){}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflator.inflate(R.layout.fragment_about_me, container, false);
return rootView;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
((MainActivity) activity).onSectionAttached(1);
}
}
In all i get the following errormessages: 1. "inflater": Cannot resolve symbol inflator 2. "activity": Cannot resolve symbol activity
Thanks