导航菜单

页面标题

页面副标题

Cashalo v2.25.0.0 - CaptureActivity.java 源代码

正在查看: Cashalo v2.25.0.0 应用的 CaptureActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.oriente.qrcodelibrary.activity;

import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import androidx.fragment.app.FragmentActivity;
import com.oriente.qrcodelibrary.R;
import com.oriente.qrcodelibrary.callback.QRCodeAnalyzeCallback;

public class CaptureActivity extends FragmentActivity implements QRCodeAnalyzeCallback {
    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        ZXingLibrary.initDisplayOption(getApplicationContext());
        setContentView(R.layout.camera);
        Bundle extras = (getIntent() == null || getIntent().getExtras() == null) ? null : getIntent().getExtras();
        CaptureFragment captureFragment = new CaptureFragment();
        if (extras != null) {
            captureFragment.setArguments(extras);
        }
        captureFragment.setmQRCodeAnalyzeCallback(this);
        getSupportFragmentManager().beginTransaction().replace(R.id.fl_qa_scan, captureFragment).commit();
    }

    @Override
    public void onAnalyzeSuccess(Bitmap bitmap, String str) {
        Intent intent = new Intent();
        Bundle bundle = new Bundle();
        bundle.putInt(CodeUtils.RESULT_TYPE, 1);
        bundle.putString(CodeUtils.RESULT_STRING, str);
        intent.putExtras(bundle);
        setResult(-1, intent);
        finish();
    }

    @Override
    public void onAnalyzeFailed() {
        Intent intent = new Intent();
        Bundle bundle = new Bundle();
        bundle.putInt(CodeUtils.RESULT_TYPE, 2);
        bundle.putString(CodeUtils.RESULT_STRING, null);
        intent.putExtras(bundle);
        setResult(-1, intent);
        finish();
    }
}