package com.fitchgc.jcwallet.activity; import android.content.Intent; import android.os.Bundle; import android.widget.Button; import android.widget.TextView; import com.fitchgc.jcwallet.R; import com.king.zxing.CaptureActivity; import static com.fitchgc.jcwallet.MainActivity.KEY_TITLE; public class CustomCaptureActivity extends CaptureActivity { private static final String TAG = CustomCaptureActivity.class.getSimpleName(); @Override public int getLayoutId() { return R.layout.custom_capture_activity; } @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Intent in = getIntent(); String title = in.getStringExtra(KEY_TITLE); Button localBtn = findViewById(R.id.qrLocalBtn); localBtn.setOnClickListener(v -> onClickLocalImg()); TextView titleLabel = findViewById(R.id.scanQrTitleLabel); titleLabel.setText(title); } @Override public void initCameraScan() { super.initCameraScan(); getCameraScan() .setPlayBeep(true) .setVibrate(true); } protected void onClickLocalImg(){ Intent ins=new Intent(); ins.putExtra("localImg", true); setResult(1, ins); finish(); } }