我目前的Zxing扫描仪屏幕看起来像这样, 在此处输入图像描述
我想添加一个textview和几个按钮,我已经尝试了很多程序,但没有任何工作可以任何人指导我,我会谦卑地期待你的帮助
继承守守则
Java文件:
private ZXingScannerView mScannerView;
@Override
public void onCreate(Bundle state) {
super.onCreate(state);
setContentView(R.layout.activity_qrresult);
mScannerView = new ZXingScannerView(this);
setContentView(mScannerView);
}
@Override
public void onResume() {
super.onResume();
mScannerView.setResultHandler(this);
mScannerView.startCamera();
Toast.makeText(getApplicationContext(),"Scan QR code to Send
Money",Toast.LENGTH_LONG).show();
}
@Override
public void onPause() {
super.onPause();
mScannerView.stopCamera(); // Stop camera on pause
}
@Override
public void handleResult(Result rawResult) {
// Do something with the result here
if(rawResult.getText().toString().equals("Test Ewallet Test")){
Toast.makeText(getApplicationContext(), rawResult.getText(),
Toast.LENGTH_SHORT).show();
Intent go = new Intent(qrresult.this,sendmoney.class);
startActivity(go);
}else {
Toast.makeText(getApplicationContext(), "Couldn't scan …Run Code Online (Sandbox Code Playgroud)