我的媒体播放器有问题,因为我在我的lg-smartphone上将我的android -version更新为5.0.2.
我有一个独立的课程来播放音乐
public class MediaPlayerService {
public static MediaPlayer mediaPlayer;
private static SoundPool soundPool;
public static boolean isplayingAudio = false;
static int soundID;
public static enum State {
Stopped,
Playing,
}
static State mState = State.Stopped;
public static void playAudioFromMediaPlayer(Context c) {
mediaPlayer = new MediaPlayer();
mediaPlayer = MediaPlayer.create(c, R.raw.hooray);
if (!mState.equals(State.Stopped)) {
mediaPlayer.start();
mState = State.Playing;
}
}
@SuppressWarnings("deprecation")
public static void loadAudioFromSoundPool(Context c, int id) {
soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 100);
soundID = soundPool.load(c, SoundList.soundList.get(id), 1); …Run Code Online (Sandbox Code Playgroud) 我编写了一个使用谷歌地图api v2的Android应用程序.我想在模拟器上测试它,但为了显示地图它有一些问题.我用谷歌搜索并发现了我必须安装到软件包(vending.apk,android.gms.apk).我下载了包并安装了它.我不知道的是,安装的android.gms.apk不是最新的.当我在模拟器上运行应用程序时,它会显示一个按钮和一条消息:...更新Google Play服务.现在我找到了.gms.apk的最新版本.但我无法删除或更新模拟器上的谷歌播放服务,因为我从cmd成为以下消息:

有这些问题的解决方案吗?thx提前
我用swipeview构建了一个音乐播放器项目(2个片段).一个片段有开始按钮,当我点击开始按钮时,另一个片段显示歌曲的元数据信息以及搜索栏.我的问题是在播放时通过一首歌获得当前时间.
片段的代码看起来像这样:
public static class SongParameterFragment extends Fragment {
public SeekBar seekBar;
static int fragmentNR;
public ImageView cover;
public TextView songParameter, songDuration;
runnableTimeline timelineMonitor;
public SongParameterFragment(int position) {
this.fragmentNR = position;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(com.example.swipeview3.R.layout.song_parameters, container, false);
cover = (ImageView)v.findViewById(com.example.swipeview3.R.id.imageView1);
songParameter = (TextView)v.findViewById(com.example.swipeview3.R.id.textView_SongParameter);
songDuration = (TextView)v.findViewById(com.example.swipeview3.R.id.textView_SongDuration);
seekBar = (SeekBar)v.findViewById(com.example.swipeview3.R.id.seekBar);
seekBar.setOnSeekBarChangeListener(seekBarChangeListener);
timelineMonitor = new runnableTimeline();
Thread thread = new Thread(timelineMonitor);
thread.start();
return v;
}
SeekBar.OnSeekBarChangeListener seekBarChangeListener = new OnSeekBarChangeListener() { …Run Code Online (Sandbox Code Playgroud) android android-music-player android-resources android-handler
android ×3