小编Lon*_*der的帖子

如何在Zxing Scanner Camera View中添加按钮

我目前的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)

java xml android qr-code zxing

3
推荐指数
1
解决办法
5426
查看次数

标签 统计

android ×1

java ×1

qr-code ×1

xml ×1

zxing ×1