2

New(er) to android fragments and developing an app with two areas 80/20 on screen. Within the 80% area, there's an area dedicated to fragments, with each fragment containing one button; the number of fragments is created dynamically, so my ViewPager layout area is created dynamically as well. When a button is pressed within the fragment, an "item" will be populated within the ListView of the remaining 20% area (basically like choosing an item and populating a shopping cart).

What is the best implementation for handling the OnClickListeners in each of these scenarios:

  • "selecting" the item (button press) within the fragment as to populate the ListView (shopping cart) with the item
  • "deleting" (button press) the items from the ListView (shopping cart)
  • "checkout" (button press)

I'm currently using a FragmentActivity as my main activity and a FragmentStatePagerAdapter and a custom Fragment class.

Thanks for any guidance!

Vic
  • 425
  • 1
  • 4
  • 7

0 Answers0