Answer the question
In order to leave comments, you need to log in
How to get to the ListView element by ID located in the ListAdapter that is loaded into the FragmentTabsPager?
Help to get to the ListView element (by ID?), from the FragmentTabsPager "Activity" (SherlockFragmentActivity), to determine the coordinates of the list element received through the ListAdapter. It is required to supply this data to the target input for ShowcaseView.
Fragment frag1 = getSupportFragmentManager().findFragmentById(R.id.pager);
//Если фрагмент не существует (null) или не является частью разметки (isInLayout), то переменная mIsDynamic будет иметь значение true.
mIsDynamic = frag1 == null || !frag1.isInLayout();
Toast.makeText(this, mIsDynamic + " не неайдено", Toast.LENGTH_SHORT).show();
ViewPager vp = (ViewPager) this.findViewById(R.id.pager); //находит
TextView tv = (TextView) vp.findViewById(R.id.Text1); //возвращает NullPointerException
TextView tv = (TextView) this.findViewById(R.id.Text1); //возвращает NullPointerException
Answer the question
In order to leave comments, you need to log in
So have you tried it?
ViewPager vp = (ViewPager) this.findViewById(R.id.pager); //находит
Fragment currentFragment = vp.getAdapter().getItem(vp.getCurrentItem());
View fragmentView = currentFragment.getView
TextView tv = (TextView) fragmentView.findViewById(R.id.Text1);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question