I have a simple Angular app, that has an
<input type="file" id="file" accept=".png,.jpg"(change)="handleFileInput($event)">
and when click the choose file button my app crashes with:
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=601434129, result=0, data=null} to activity {com.piicco.app/com.piicco.app.MainActivity}: java.lang.IllegalStateException: showFileChooser result was already called
at android.app.ActivityThread.deliverResults(ActivityThread.java:5015)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5056)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.IllegalStateException: showFileChooser result was already called
However, when removing the accept=".png,.jpg"
it works (but the user can select any types of file, which is bad)