`
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Switch;`
I try that clicking on an item in a list that is in a fragmnet takes me to another fragment
You must import
Fragment
andFragmentManager
fromandroid.support.v4.app.Fragment
andandroid.support.v4.app.FragmentManager
respectively (NOT fromandroid.app.Fragment
andandroid.app.FragmentManager
).example:
If you claim to have the above then the problem is the context, the context you would use would be the
Activity
one that contains theFragment
, in this case it should be: