我正在使用以下意图来录制声音
Intent intent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
startActivityForResult(intent, REQUEST_RECORD_SOUND);
当代码返回到我的程序(在 onActivityResult 中)时,记录不会存储,并且 log cat 显示错误。这只发生在带有 android 2.3 版本的 Sony XPERIA 上。任何帮助将不胜感激。以下是 logcat 的输出:
01-02 21:43:17.837: E/Database(557): Error inserting album_id=8 title=2013-01-02 21:43:17 title_key=Q*?Q*?Q*?Q*?Q?Q*?Q*?Q?Q*?Q*?QQ*?Q*?QØQ*?Q*?QØQ*?Q*?Q mime_type=audio/3gpp _display_name=recording-379099974.3gpp date_modified=1357188193 date_added=1357188197 artist_id=8 is_music=0 _data=/mnt/sdcard/recording-379099974.3gpp
01-02 21:43:17.837: E/Database(557): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed
01-02 21:43:17.837: E/Database(557): at android.database.sqlite.SQLiteStatement.native_execute(Native Method)
01-02 21:43:17.837: E/Database(557): at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:61)
01-02 21:43:17.837: E/Database(557): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1590)
01-02 21:43:17.837: E/Database(557): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1434)
01-02 21:43:17.837: E/Database(557): at com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:1981)
01-02 21:43:17.837: E/Database(557): at com.android.providers.media.MediaProvider.insert(MediaProvider.java:1800)
01-02 21:43:17.837: E/Database(557): at android.content.ContentProvider$Transport.insert(ContentProvider.java:198)
01-02 21:43:17.837: E/Database(557): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:146)
01-02 21:43:17.837: E/Database(557): at android.os.Binder.execTransact(Binder.java:324)
01-02 21:43:17.837: E/Database(557): at dalvik.system.NativeStart.run(Native Method)
01-02 21:43:18.057: E/WindowManager(1524): Activity com.android.soundrecorder.SoundRecorder has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@2afe6e80 that was originally added here
01-02 21:43:18.057: E/WindowManager(1524): android.view.WindowLeaked: Activity com.android.soundrecorder.SoundRecorder has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@2afe6e80 that was originally added here
01-02 21:43:18.057: E/WindowManager(1524): at android.view.ViewRoot.<init>(ViewRoot.java:267)