Я пытаюсь запустить родную запись, появляется диктофон, и когда он сохраняет клип, мое приложение показывает ошибку.я использую htc desire и htc wildfire, а также тестирую на эмуляторе,
Intent intent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
startActivityForResult(intent, GET_AUDIO);
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case GET_AUDIO:
Log.i(TAG, data.getDataString());
break;
}
}
мое сообщение Logcat
09-18 15:18:35.015: ERROR/ContentService(98): Content Service Crash
09-18 15:18:35.015: ERROR/ContentService(98): java.lang.NullPointerException
09-18 15:18:35.015: ERROR/ContentService(98): at android.content.ContentService.notifyChange(ContentService.java:166)
09-18 15:18:35.015: ERROR/ContentService(98): at android.content.IContentService$Stub.onTransact(IContentService.java:91)
09-18 15:18:35.015: ERROR/ContentService(98): at android.content.ContentService.onTransact(ContentService.java:83)
09-18 15:18:35.015: ERROR/ContentService(98): at android.os.Binder.execTransact(Binder.java:288)
09-18 15:18:35.015: ERROR/ContentService(98): at dalvik.system.NativeStart.run(Native Method)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): FATAL EXCEPTION: main
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent { dat=content://media/external/audio/media/9 }} to activity {ChatActivity}: java.lang.NullPointerException
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at android.app.ActivityThread.deliverResults(ActivityThread.java:3712)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3754)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at android.app.ActivityThread.access$2800(ActivityThread.java:135)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2162)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at android.os.Handler.dispatchMessage(Handler.java:99)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at android.os.Looper.loop(Looper.java:143)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at android.app.ActivityThread.main(ActivityThread.java:4914)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at java.lang.reflect.Method.invokeNative(Native Method)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at java.lang.reflect.Method.invoke(Method.java:521)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at dalvik.system.NativeStart.main(Native Method)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): Caused by: java.lang.NullPointerException
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at android.os.Parcel.readException(Parcel.java:1253)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at android.os.Parcel.readException(Parcel.java:1235)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at android.content.IContentService$Stub$Proxy.notifyChange(IContentService.java:458)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at android.content.ContentResolver.notifyChange(ContentResolver.java:850)
09-18 15:18:35.245: ERROR/AndroidRuntime(4477): at android.content.ContentResolver.notifyChange(ContentResolver.java:836)