Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old November 13th, 2012, 01:40 PM   #1 (permalink)
Member
Thread Author (OP)
 
Join Date: Nov 2010
Location: London
Posts: 210
 
Device(s): HTC Desire HD, Samsung Galaxy SII, Samsung Galaxy Nexus, ASUS Nexus 7
Carrier: Not Provided

Thanks: 16
Thanked 8 Times in 7 Posts
Default Fragments for Horizontal scrolling, use onClicks to move to certain Fragments?

Hopefully this is do-able.

I've set up a horizontal scrolling system using FragmentPagerAdapter. Is there a way that I can click on an TextView/ImageView and then it'll take me to one of my Fragments? I want to improve the UI of my app by giving the user the option to scroll left and right but to also click a few buttons on my first Fragment to go to each of the screens too.

Is this possible?

I tried an ordinary OnClickListener but that gives me a force close. Mostly because I used startActivity() and I'm not trying to start an activity rather a Fragement but I don't know how to do that.

Overall maybe there is an easier way though, I've seen apps that have horizontal scrolling and when you click a button on one page you see the scrolling animation take them to the requested page.

Like I said I have an ordinary FragmentPagerAdapter set up with all the code it's just getting this final bit of the puzzle.

Any help would be greatly appreciated.

__________________
Twitter.

My Android apps: Link to play store.
RED_ is offline  
Reply With Quote
sponsored links
Old November 16th, 2012, 05:25 PM   #2 (permalink)
Member
Thread Author (OP)
 
Join Date: Nov 2010
Location: London
Posts: 210
 
Device(s): HTC Desire HD, Samsung Galaxy SII, Samsung Galaxy Nexus, ASUS Nexus 7
Carrier: Not Provided

Thanks: 16
Thanked 8 Times in 7 Posts
Default

Sorry to bump. Anyone?

I just want to give the user two options. They can either click on a TextView to take them to one of my Fragments pages. Or swipe left/right to get to that fragment.

It's the clicking on a TextView bit I can't get. How does one implement that?
RED_ is offline  
Reply With Quote
Reply
Tags
android, fragmentpager, fragmentpageradapter, horizontal scroll, onclick, scrolling, viewpager


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 10:31 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.