Learning how to use fragments in android. I'm following documentation on Android: https://developer.android.com/training/basics/fragments/communicating.html
According to documentation I'm suppose to use static to implement my fragment interface in my activity.
However I'm getting error. "modifier static not allowed"
My host activity:
public static class RecordWorkoutActivity extends AppCompatActivity
implements WorkoutFragment.OnFragmentInteractionListener{
My fragment:
public class WorkoutFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private OnFragmentInteractionListener mListener;
Ultimately I need my activity to display one fragment if on landscape orientation and a different fragment if on Portrait but for know I just need to be able to connect my fragments with my Activity.