Here is my code. ContentValues values = new ContentValues(); values.put(MediaStore.MediaColumns.DATA, newSoundFile.getAbsolutePath()); values.put(MediaStore.MediaColumns.TITLE, "my ringtone"); values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/*"); values.put(MediaStore.MediaColumns.SIZE, newSoundFile.length()); values.put(MediaStore.Audio.Media.ARTIST, R.string.app_name); values.put(MediaStore.Audio.Media.IS_RINGTONE, true); values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true); values.put(MediaStore.Audio.Media.IS_ALARM, true); values.put(MediaStore.Audio.Media.IS_MUSIC, false); Uri uri = MediaStore.Audio.Media.getContentUriForPath(newSoundFile .getAbsolutePath()); Uri newUri = mCr.insert(uri, values); try { RingtoneManager.setActualDefaultRingtoneUri(RingToneActivity.this, RingtoneManager.TYPE_RINGTONE, newUri); } catch (Throwable t) { Log.d("Eroor", "catch exception"); } but i get [...]
The post SQLiteConstraintException: error code 19: constraint failed when set ringtones appeared first on BlogoSfera.