Created
July 11, 2012 07:02
-
-
Save masarugen/3088544 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | |
if (resultCode == RESULT_OK) { | |
if (requestCode == RINGTONE_PICKER) { | |
// RINGTONE_PICKERからの選択されたデータを取得する | |
mUri = (Uri) data.getExtras().get(RingtoneManager.EXTRA_RINGTONE_PICKED_URI); | |
Ringtone ringtone = RingtoneManager.getRingtone(getApplicationContext(), mUri); | |
TextView ringView = (TextView) findViewById(R.id.ringtone); | |
ringView.setText(ringtone.getTitle(getApplicationContext())); | |
ringtone.setStreamType(AudioManager.STREAM_ALARM); | |
ringtone.play(); | |
SystemClock.sleep(1000); | |
ringtone.stop(); | |
} | |
} | |
super.onActivityResult(requestCode, resultCode, data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment