如何将Zxing扫描结果粘贴到我的两个editText上

我正在开发一个简单的项目,即QR码扫描是登录的另一种选择。

我正在尝试使用Zxing,我尝试了youtube上几乎所有的教程,但找不到答案。

我想要的是,当我扫描QR码时,可以将结果粘贴到editTextUsereditTextPass上。

非常感谢您的帮助,我不知道该向哪里提问,所以希望您能提供帮助,我非常感谢您的帮助。

public class ScanResult extends AppCompatactivity implements ZXingScannerView.ResultHandler{


    private ZXingScannerView mScannerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scan_result);

        mScannerView = new ZXingScannerView(this);   // Programmatically initialize the scanner view
        setContentView(mScannerView);                // Set the scanner view as the content view
    }

    @Override
    public void onResume() {
        super.onResume();
        mScannerView.setResultHandler(this); // Register ourselves as a handler for scan results.
        mScannerView.startCamera();          // Start camera on resume
    }

    @Override
    public void onPause() {
        super.onPause();
        mScannerView.stopCamera();           // Stop camera on pause
    }

    @Override
    public void handleResult(Result rawResult) {
        // Do something with the result here
        // Log.v("tag",rawResult.getText()); // Prints scan results
        // Log.v("tag",rawResult.getBarcodeFormat().toString()); // Prints the scan format (qrcode,pdf417 etc.)


        Intent returnIntent = new Intent();
        returnIntent.putExtra("scanned",rawResult.getText());
        setResult(activity.RESULT_OK,returnIntent);
        finish();

        //LoginScan.textView4.setText(rawResult.getText());
        //LoginScan.textView6.setText(rawResult.getText());
        //onBackpressed();


        // If you would like to resume scanning,call this method below:
        //mScannerView.resumeCameraPreview(this);
    }



    }
xinkaikou 回答:如何将Zxing扫描结果粘贴到我的两个editText上

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3147823.html

大家都在问