import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import static android.icu.lang.UCharacter.GraphemeClusterBreak.T;
import static com.example.noah.app1.R.id.lstview;
public class Tab2 extends Fragment {
ListView lstview;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.tab2, container, false);
lstview = (ListView) rootView.findViewById(R.id.lstview);
Tab2_list_view adapter = new Tab2_list_view(Tab2.this);
lstview.setAdapter(adapter);
return rootView;
}
}
Here I get an error saying: Error:(27, 57) error: incompatible types: Tab2 cannot be converted to Context
Tab2 is my MainActivity and Tab2_list_view has my code on for a ListView.
How can I fix this?