How to read barcode in child activity

K Kha Tran 3 years 6 months ago
4 1 0

Hello,
 
I has setup the barcode reading in parent form (List Activity) which search particular item based on barcode value and open the child form (detail activity). All are working!
 
public class BarcodeActivity    extends BaseActivity    implements EMDKManager.EMDKListener, Scanner.DataListener, Scanner.StatusListener, BarcodeManager.ScannerConnectionListener { ... @Override public void Search(String code){    try {   ParcelModel model = ParcelService.Get(code);    if (model==null){   showToast("Parcel " + code + " is missing");   }    else{   openParcel(model);   }   }    catch (Exception ex){   showToast(ex.getMessage());   } } ... } 
In the child form, I would like to read the barcode to its text boxes or process its own Search function. However Search function in parent form is handling the event instead.
 
Any idea please?

Please Register or Login to post a reply

1 Replies

Y Yanis Dalabiras

Hello Kha,
I'm not sure I completely follow what you are trying to accomplish. Please provide a more complete sample of what you are trying to solve ( sample of both activities )

What I think you are trying to solve is passing data collected in one activity to another. If that's the case, have a look at the "Starting Activities and Getting Results" section of the following google api guide. The code example shows how to bundle data when starting an activity.

Activity | Android Developers

CONTACT
Can’t find what you’re looking for?