首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

设立铃声后继续相关操作

2012-09-24 
设置铃声后继续相关操作Intent intent new Intent(RingtoneManager.ACTION_RINGTONE_PICKER)?intent.pu

设置铃声后继续相关操作

Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);?
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);?
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select Tone");?
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri) null);?
this.startActivityForResult(intent, 5);?

然后

@Override?
?protected void onActivityResult(final int requestCode, final int resultCode, final Intent intent)?
?{?
? ? ?if (resultCode == Activity.RESULT_OK && requestCode == 5)?
? ? ?{?
? ? ? ? ? Uri uri = Intent.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);?
?
? ? ? ? ? if (uri != null)?
? ? ? ? ? {?
? ? ? ? ? ? ? this.chosenRingtone = uri.toString();?
? ? ? ? ? }?
? ? ? ? ? else?
? ? ? ? ? {?
? ? ? ? ? ? ? this.chosenRingtone = null;?
? ? ? ? ? }?
? ? ? } ? ? ? ? ? ??
? }?

热点排行