I am developing an application that involves QR scanning.I am able to get scanner application working by using Zxing library, which is launched from my application A. I need to store the information of the scanned product in textbox or editbox and later use it for some other purpose .
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent intent = new Intent(MainActivity.this,
CaptureActivity.class);
// Intent intent = new
// Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(intent, 0);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == 0) {
if (resultCode == 1) {
// Handle successful scan
String capturedQrValue = intent.getStringExtra("RESULT");
// String format =
intent.getStringExtra("SCAN_RESULT_FORMAT");
Toast.makeText(MainActivity.this,"Scan Result:" + capturedQrValue, Toast.LENGTH_SHORT).show();
finish();
Intent it=new Intent(MainActivity.this,ThirdActivity.class);
it.putExtra("Code", capturedQrValue);
startActivity(it);
Please help me on the same.