作者sweet00914 (别理我)
看板AndroidDev
标题[问题] stopService无效,请求协助0.0
时间Fri Feb 10 11:01:27 2012
请问各位大大,
当我设置一个button中的onclick事件为
stopService(new Intent(mServiceList.get(i).service.getClassName().toString()));
没有办法将我欲停止的Service给停止。
接着尝试方法二:
protected void stopMusicService() {
Intent i = new Intent();
i.setClassName("com.android.music",
"com.android.music.MediaPlaybackService");
this.stopService(i);
}
也是没有办法将MediaPlaybackService给停止。
请问各位是否给予小弟协助建议,谢谢。
---------------------------------------------
刚刚我再虚拟device测试方法二,可以将service停止。
但是在实际上的deivce却没有办法停止,请问各位大大有无任何建议呢?谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.130.55.241
※ 编辑: sweet00914 来自: 220.130.55.241 (02/10 12:58)
※ 编辑: sweet00914 来自: 220.130.55.241 (02/10 13:21)
1F:推 cheswe:Intent i = new Intent(this,MediaPlaybackService.class); 02/10 14:44
2F:→ cheswe:stopService(i); 试试看吧 02/10 14:45