| | |
| | | setData(); |
| | | initView(); |
| | | // LibraryInitOCR.initOCR(NewCardActivity.this); |
| | | // registerForActivityResult() |
| | | } |
| | | |
| | | private void initView() { |
| | |
| | | private void startCamera() { |
| | | Intent intent = new Intent(NewCardActivity.this, CameraActivity.class); |
| | | intent.putExtra("typeFront", 1); |
| | | startActivityForResult(intent, 110); |
| | | startActivityForResult(intent, SCAN_IDCARD_REQUEST); |
| | | } |
| | | |
| | | @Override |
| | |
| | | // sb.append(String.format("整体照片 = %s\n", jo.opt("imgPath"))); |
| | | // sb.append(String.format("头像路径 = %s\n", jo.opt("headPath"))); |
| | | |
| | | newCardBinding.newCardName.setText(jo.opt("name").toString()); |
| | | newCardBinding.newCardId.setText(jo.opt("num").toString()); |
| | | String name = jo.getJSONObject("Name").opt("value").toString(); |
| | | String idNumber = jo.getJSONObject("Num").opt("value").toString(); |
| | | this.runOnUiThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | newCardBinding.newCardName.setText(name); |
| | | newCardBinding.newCardId.setText(idNumber); |
| | | newCardBinding.newCardIdTip.setVisibility(View.VISIBLE); |
| | | } |
| | | }); |
| | | |
| | | |
| | | } catch (JSONException e) { |
| | | throw new RuntimeException(e); |