I have got an app with a tabLayout of 2 fragments with listView and I want to load the content from a URLConnection with Json but in the Fragment.java file I geht the Error: can't resolve method 'findViewByID(int)'.
public class Fragment1 extends Fragment implements URLConnectionResponse {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
CanteenProvider canProv = new CanteenProvider();
canProv.delegate = this;
canProv.getDishes(getActivity().getApplicationContext());
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.activity_canteen_tab_mensa, container, false);
}
@Override
public void processFinish(List<?> output) {
ListView canteenList = (ListView) findViewById(R.id.mensalistView);
ArrayList<Dish> canteenItemContent = new ArrayList<Dish>();
canteenItemContent = (ArrayList<Dish>)output;
CanteenListAdapter canteenAdapter = new CanteenListAdapter(canteenItemContent, this);
canteenList.setAdapter(canteenAdapter);
}
}