Swa*_*oid 27 android android-intent android-service
我想从列表视图项的片段开始服务.我试图用以下方式呼叫服务:
startService(new Intent(getActivity(),myPlayService.class));
Run Code Online (Sandbox Code Playgroud)
但它根本不起作用.我如何从片段中调用我的服务?还有其他方法可以开始服务吗?
Dro*_*der 97
更换
startService(new Intent(getActivity(),myPlayService.class));
同
getActivity().startService(new Intent(getActivity(),myPlayService.class));
归档时间: |
|
查看次数: |
34609 次 |
最近记录: |