Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. ReadIt = new TessBaseAPI();
  2. ReadIt.init(datapath,"eng");
  3.  
  4. class ProcessImageAsync extends AsyncTask<Void, Void, String> {
  5.  
  6. @Override
  7. protected String doInBackground(Void... voids) {
  8. try{
  9.  
  10. ReadIt.setImage(new File(currentPhotoPath));
  11. return ReadIt.getUTF8Text();
  12. }catch (Exception ex){
  13.  
  14. ex.printStackTrace();
  15. return "";
  16. }
  17.  
  18. }
  19.  
  20. @Override
  21. protected void onPostExecute(String s) {
  22. if(!s.equalsIgnoreCase("")){
  23. TextView textView = (TextView)findViewById(R.id.textView);
  24. textView.setText(s);
  25. }else{
  26. Utility.showToast(MainActivity.this, "invalid Data");
  27. }
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement