1
Intent intent=new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
startActivityForResult(intent, VoiceHandler.VOICE_FLAG);

此代码在我的 ICS 设备上执行良好,但不适用于我的 android 2.3 设备,此代码抛出

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.provider.MediaStore.RECORD_SOUND }
4

1 回答 1

-1

尝试这个:

为您的清单

<intent-filter>
<action android:name="android.provider.MediaStore.RECORD_SOUND" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

生成意图:

i = new Intent("android.provider.MediaStore.RECORD_SOUND");
于 2012-07-31T11:01:45.693 回答