editor.putString("order_Play", "is_Order");
editor.putString("random_Play", null);}
if (random_Play.isChecked()) {
editor.putString("sigle_Play", null);
editor.putString("order_Play", null);
editor.putString("random_Play", "is_Random");}
if (lyLrc.isChecked()) {
editor.putString("lyLrc", "is_Show");}
if (!lyLrc.isChecked()) {
editor.putString("lyLrc", null);}
editor.commit();
Intent intent = new Intent();
setResult(4, intent);
finish();
} else if (event.getAction() == MotionEvent.ACTION_UP) {
v.setBackgroundResource(R.drawable.share);}
return false;}
};
}
4.4.3 歌词显示实现
播放器歌词显示功能实现代码:
private void showLrc(String musicName) {
if ("is_Show".equals(lrc_Show)) {
String strTime; String strWord;
String musicTitle;
if (mplayer.isPlaying())
LrcShow.showLrc(musicName, MainPlayActivity.this);
SharedPreferences lrc_sp = getSharedPreferences("LRC_SHOW",
MODE_WORLD_READABLE);
if (lrc_sp != null) {
strTime = lrc_sp.getString("LRC_TIME", null);
strWord = lrc_sp.getString("LRC_WORD", null);
musicTitle = lrc_sp.getString("MUSIC_TITLE", null);
if ((strTime != null) && (strWord != null)
&& musicTitle.equals(musicName)) {
Log.i("info", musicTitle + "......." + musicName);
lrc_time = StringHelper.spiltString(strTime); 基于Android手机平台音乐播放器开发设计(15):http://www.751com.cn/jisuanji/lunwen_1408.html