-1

I would like to have a barcode reader/generator in my app, preferably in one activity. For iOS i think this can be done using a segmented view controller. How would I do this in android? Or should i just put them on two different activities?

user3794585
  • 203
  • 1
  • 11
  • To use barcode reader and generator you can use ZXing Lib and yes you can put both in same activity. – DJhon Jul 23 '14 at 03:54

1 Answers1

1

Assuming from what I could understand from your question:

you could use a ViewPager, you can read more at http://developer.android.com/training/implementing-navigation/lateral.html

Or if you want the look and feel of IOS segmented control, probably you could create two buttons and change fragments based on which button has been clicked.

Take a look at this (assuming you understand fragments) How to replace a Fragment on button click of that fragment?

Fragments are close to UIViews in IOS. If you are not well versed with fragments, this might help http://www.tutorialspoint.com/android/android_fragments.htm

Community
  • 1
  • 1
Veeru
  • 4,936
  • 2
  • 43
  • 61