getodk / collect

ODK Collect is an Android app for filling out forms. It's been used to collect billions of data points in challenging environments around the world. Contribute and make the world a better place! ✨📋✨
https://docs.getodk.org/collect-intro
Other
717 stars 1.37k forks source link

Crash when user selects audio that was just recorded #695

Closed rajatthakur closed 7 years ago

rajatthakur commented 7 years ago

Software and hardware versions

Collect v1.4.16, Android v4.4.4, Motorola XT1022

Problem description

Null pointer returned on selecting recorded audio.

Steps to reproduce the problem

  1. Go to the audio widget.
  2. Record an audio clip.
  3. Click on choose button and select the audio clip that you just recorded.

Expected behavior

The Uri of the chosen audio file should be returned.

Other information

The issue is pretty much the same as #691.

lognaturel commented 7 years ago

I got

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=3, result=-1, data=Intent { dat=content://com.sonymobile.androidapp.audiorecorder.content/audio/1 typ=audio/raw }} to activity {org.odk.collect.android/org.odk.collect.android.activities.FormEntryActivity}: java.lang.UnsupportedOperationException: You cannot use this method
    at android.app.ActivityThread.deliverResults(ActivityThread.java:3699)
    at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742)
    at android.app.ActivityThread.-wrap16(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.UnsupportedOperationException: You cannot use this method
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:167)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
    at android.content.ContentProviderProxy.delete(ContentProviderNative.java:544)
    at android.content.ContentResolver.delete(ContentResolver.java:1327)
    at org.odk.collect.android.activities.FormEntryActivity.onActivityResult(FormEntryActivity.java:713)
    at android.app.Activity.dispatchActivityResult(Activity.java:6456)
    at android.app.ActivityThread.deliverResults(ActivityThread.java:3695)
    ... 9 more
   Force finishing activity org.odk.collect.android/.activities.FormEntryActivity

filed as #705

lognaturel commented 7 years ago

Which app do you use to record audio?

rajatthakur commented 7 years ago

@lognaturel I used the default recoding app that comes with stock android.

shobhitagarwal1612 commented 7 years ago

fixed in #696