コード例 #1
1
  /* 分享选中的音乐 */
  private void ShareMusicFile() {

    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setType("audio/*");
    File file = new File(music.getMusicName());
    Uri u = Uri.fromFile(file);
    intent.putExtra(Intent.EXTRA_STREAM, u);
    System.out.println(music.getMusicName());
    intent.putExtra(Intent.EXTRA_SUBJECT, "分享");
    intent.putExtra(Intent.EXTRA_TEXT, "当前被分享歌曲:" + music.getMusicName() + "(用户通过魔乐盒分享了一首歌曲)");
    startActivity(Intent.createChooser(intent, getTitle()));
    return;
  }
コード例 #2
1
 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()));
   }
 }