0

I am writing code to run RECORD_SOUND

    Intent intent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
    startActivityForResult(intent, AUDIO_RESULT);

works on all phones, but it crashes LGP500

what is the problem?

04-28 14:54:18.754: E/AndroidRuntime(10446): FATAL EXCEPTION: main
04-28 14:54:18.754: E/AndroidRuntime(10446): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.provider.MediaStore.RECORD_SOUND }
04-28 14:54:18.754: E/AndroidRuntime(10446):    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at android.app.Activity.startActivityForResult(Activity.java:2817)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at com.webparadox.tonquer.Map.sound(Map.java:537)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at com.webparadox.tonquer.Map.onClick(Map.java:559)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at android.view.View.performClick(View.java:2408)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at android.view.View$PerformClick.run(View.java:8816)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at android.os.Handler.handleCallback(Handler.java:587)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at android.os.Handler.dispatchMessage(Handler.java:92)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at android.os.Looper.loop(Looper.java:123)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at android.app.ActivityThread.main(ActivityThread.java:4627)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at java.lang.reflect.Method.invokeNative(Native Method)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at java.lang.reflect.Method.invoke(Method.java:521)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
04-28 14:54:18.754: E/AndroidRuntime(10446):    at dalvik.system.NativeStart.main(Native Method)
4

1 回答 1

0

我自己发现在 android 中使用音频记录是最糟糕的工作。由于录音机的实现留给了 OEM,并非所有电话都可以使用 Intents 正常工作,有些电话不返回任何内容,有些电话总是返回 ACTIVITY_CANCELED。

似乎 lg 甚至还没有实现任何东西来处理 p500 手机中的语音记录,或者至少没有设置他们的语音记录来捕捉意图呼叫。您可以尝试安装另一个录制到手机的声音,看看它是否有效。

顺便说一句,我想你已经设置了你的权限,对吧?:P

于 2012-06-28T06:45:36.623 回答