Skip to main content

Posts

Showing posts with the label issues

Viewpager doesn't update/loads xml items

I solved the question with onclicklistsner issue with viewpager but now I noticed, that it depends on all Elements in XML Layout files. I implemented a ViewPager with that Tutorial: tutsplus Now I have the Problem, that all the Objects I defined in XML are instantiated correct (not null in Debuggin mode after findViewById etc) but I can't reffer to them. To understand it better here my PagerAdapter: class MyPagerAdapter extends PagerAdapter { public int getCount() { return 3; } public Object instantiateItem(View collection, int position) { LayoutInflater inflater = (LayoutInflater) collection.getContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); int resId = 0; switch (position) { case 0: resId = R.layout.settings_view; break; case 1: resId = R.layout.push_view; break; case 2: resId = R.layout.listen_view; break;