Tribler / trustchain-android

An example android app for using trustchain
GNU Lesser General Public License v3.0
3 stars 2 forks source link

fix permission loop in ocr scanner #41

Closed wkmeijer closed 6 years ago

wkmeijer commented 6 years ago

When permissions are denied, the manual input activity is opened. Fixes #31

klikooo commented 6 years ago

I got an exception when I accept the permissions and then go back on install:

    java.util.NoSuchElementException
        at java.util.ArrayList$Itr.next(ArrayList.java:834)
        at java.util.Collections.max(Collections.java:742)
        at nl.tudelft.cs4160.trustchain_android.passport.ocr.TesseractOCR.giveStats(TesseractOCR.java:227)
        at nl.tudelft.cs4160.trustchain_android.passport.ocr.TesseractOCR.cleanup(TesseractOCR.java:206)
        at nl.tudelft.cs4160.trustchain_android.passport.ocr.TesseractOCR$3.run(TesseractOCR.java:124)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:154)
        at android.os.HandlerThread.run(HandlerThread.java:61)

Quick fix might be to remove the giveStats funtion

jonathanraes commented 6 years ago

@klikooo very strange crash i got the same

jonathanraes commented 6 years ago

I suppose it happens because the times list is still empty, could have added an if but its not that important

wkmeijer commented 6 years ago

Ok, I'll do that, that's a bit less lazy.

klikooo commented 6 years ago

It works now!