public void ShowNowPlayMusic() { Music music = MyApplication.musics.get(position); if (music != null) { nowbitmap = BitmapTool.getbitBmBykey(context, music.getAlbumkey()); if (nowbitmap != null && nowbitmap.isRecycled() == false) { list_show_album.setImageBitmap(nowbitmap); } else { list_show_album.setImageResource(R.drawable.default_bg_s); } tvsongname.setText(music.getMusicName()); tvdurction.setText("00:00/" + StrTime.getTime(music.getTime())); } }
@Override public void onReceive(Context context, Intent intent) { // 更新时间进度 if (intent.getAction().equals(Constant.ACTION_UPDATE)) { music = (Music) intent.getSerializableExtra("music"); totalms = intent.getIntExtra("totalms", 288888); // 总时长 int status = intent.getIntExtra("status", -1); try { String musicname = music.getMusicName(); tvdurction.setText("00:00/" + StrTime.getTime(music.getTime())); tvsongname.setText(musicname); if (intent.getBooleanExtra("isnet", false)) { nowbitmap = MyApplication.bitmap_s; } else { String albumkey = music.getAlbumkey(); if (albumkey != null && !albumkey.equals("")) { nowbitmap = BitmapTool.getbitBmBykey(context, music.getAlbumkey()); } else { nowbitmap = MyApplication.bitmap_s; } } if (nowbitmap != null && !nowbitmap.isRecycled()) { list_show_album.setImageBitmap(nowbitmap); } else { list_show_album.setImageResource(R.drawable.default_bg_s); } if (status == 3) { btplay.setImageResource(R.drawable.desktop_pausebt); isplaying = true; } else { btplay.setImageResource(R.drawable.desktop_playbt); isplaying = false; } } catch (Exception e) { e.printStackTrace(); } } else if (intent.getAction().equals(Constant.ACTION_DISS_DIALOG)) { if (progressDialog != null) { progressDialog.cancel(); } } }