android在Fragment中启动服务

1.startService(new Intent(getActivity(),mService.class));

2.getActivity().startService(new Intent(getActivity(),mService.class));

3.Intent mIntent = new Intent(getActivity(), BLeService.class);
getActivity().startService(mIntent);

你可能感兴趣的:(android基础)