android - InstantiateItem in PagerAdapter and AddView in ViewPager confusion -
So far, I'm hacking instances together to be realized as a full API Afaiodis SDK. Although I have hit a deadlock
I am trying to spread a linear layout with 2 text visas from an XML file, this will be the pages that I can just get it to work And I feel that I do not fully understand what is happening with the code.
Looking at the source, I can see that the method calls InstantiateItem from ViewPager.addNewItem supply adapter. And addNewItem is said to be populated (), populate is called in many other places.
However, I have seen instances when the override method for Pejhraadaptr, you have a call on AddView on ViewPager Collinshn which is passed from view paper as an argument .
If I want to add several scenes have so I think it would be a case of being called to add more than once, but instantiateItem ViewPager seen an object (for example, I find it It has been added) I do not know what to return I have tried to return the inflated scenes and many other things
Can anyone tell me what is happening here?
Highly appreciated.
M
View @ Override public object urgent item (collection, Int position) {layout = inflater.inflate (R.layout.animallayout, null); TextView TV = (TextView) layout.FindviewIVID (R.id.textView1); Tv.setText ("1 ________________" "+ status); TextView tv2 = (TextView) layout.findViewById (R.id.textView2); Tv.setText ("2 ________________" "+ status); ((Viewpoint) collection) .addView (layout); Return layout; } I have recently applied it and it has been applied to my instantiateItem
method (it at least a bit for readability @Override public object InstantiateItem (view collection, int position) {evaluation = evaluations.get (position) ;. see layout = inflater. increases (R.layout.layout_evaluation, nULL); TextView evaluationSummary = (TextView) layout.findViewById (R.id.evaluation_summary); evaluationSummary.setText (evaluation.getEvaluationSummary ()); ((ViewPager) collection) .addView (layout); Return Layout;} @Override Public Shun (See View, Object, view) View the ((ViewPager)) .removeView (see);} @Override Public Boolean isViewFromObject (see, object object to see) {return view == object; .} To get the page displayed, I get the data from my evaluation using the position as the index index then increase layout Anyone who has ideas I will also add my data. Lyankn to get TextView . Then the whole layout is added to the ViewPager . And finally the layout is also given. You still can not find it posting your code.
Comments
Post a Comment