I have an activity 3ChartPerTabActivity where i have 3 tabs fragment with Viepager.Each fragment view has just different color.So far is working.
My problem occurs w
getView
doesn't work until AFTER onCreateView
completes:
http://developer.android.com/reference/android/app/Fragment.html#getView()
Use the View
that you inflate in onCreateView
as a starting point to "find" your other views while you're still in onCreateView
, instead of getView
().
For example:
View view = (LinearLayout) inflater.inflate(R.layout.tab_frag1_layout,
container, false);
LinearLayout chartContainer = (LinearLayout) view.findViewById(
R.id.chart_container);
...
return view;
(Assuming "tab_frag1_layout" has the "chart_container" layout inside it.)