I have to load three layouts inside view page indicator.The three activity's are dynamic.They load contents from web services and also has grid view which gets its contents dynamically loaded.Is there any method to load activity inside view page indicator.I have used JakeWhartons view page indicator.
Asked
Active
Viewed 467 times
0
-
what do you mean by loading new activity inside new page indicator?? Do you mean you want to load new activity on page scroll(Change) – edwin Jan 28 '13 at 05:32
-
Ya while scrolling as in google playstore.Can I call a new activity inside it. – SREEJITH Jan 28 '13 at 05:34
-
sreejith i think its using fragments . so in fragment we can load activities – edwin Jan 28 '13 at 05:35
-
Sir,I called startactivity inside but it is getting force closed – SREEJITH Jan 28 '13 at 05:40
-
Refer [this](http://stackoverflow.com/questions/7951730/viewpager-and-fragments-whats-the-right-way-to-store-fragments-state) – edwin Jan 28 '13 at 05:43
-
provide more information show me what you have done till . post the code or log cat – edwin Jan 28 '13 at 05:44
-
if you need help you should provide more information .without knowing what you have done how can i help?This was my [code](http://stackoverflow.com/questions/14433281/android-fragment-pager-and-custom-page-indicator-viewpagerindicator-created-by) – edwin Jan 28 '13 at 05:55
1 Answers
0
Since You are using view Pager you should make use of Fragments to get your need
Hope this would hep you
Edit:
Th Logic i follow is MainActivity extends FragmentActivity
then in the main activity i will set custom FragmentPagerAdapter
for ViewPager
eg: ViewPagerAdapter extends FragmentPagerAdapter
Then as you say for each category ( FEATURED,CATEGORIES ,TOP PAID ,TOP FREE )
I will create fragments .
But i think you need to use one Fragment for all categories .AFAIK i can't answer your need now .but i will figure to sort out
But i want to ask something why don't you try to switch case on the string that you selected

edwin
- 7,985
- 10
- 51
- 82
-
Thanks for your answer. I have used JakeWharton library.And worked fine for me at times loading static pages.But loading dynamic pages it is not working. – SREEJITH Jan 28 '13 at 06:12
-
I have to load activity like this @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v=null; if(mContent.equalsIgnoreCase("Top News")) { Intent i=new Intent(getActivity(),activity_home.class); startActivity(i); } – SREEJITH Jan 28 '13 at 06:13
-
mContent contains String as FEATURED,CATEGORIES ,TOP PAID ,TOP FREE in google play.I the contarol comes inside the if condition.What I want to know is how to start an activity inside this condition. – SREEJITH Jan 28 '13 at 08:19
-