У меня есть два действия
Задание 1 - Добавление нового запаса
Задание 2 - Содержит устройство считывания штрих-кода
В занятии 2 я считываю штрих-код.код ниже
** public void handleResult(com.google.zxing.Result result) {
Log.e("1", "handleResult: " + result.toString(), null);
Snackbar.make(this.scannerView, "handleResult: " + result.toString(), Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
Intent customIntent = new Intent();
customIntent.putExtra("product_id", result.toString());
setResult(RESULT_OK, customIntent);
finish();
}**
On Activity 1
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// if (requestCode == 1) {
if (resultCode == RESULT_OK) {
String productCode = data.getStringExtra("product_id");
EditText t1 = findViewById(R.id.name);
t1.setText(productCode);
}
// }
}
Но функция не вызывает действие 1.