Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将服务绑定到android中的片段。尝试在片段中调用绑定服务时返回 false。
您可以通过编程方式进行操作,首先创建您的BroadcastReceiver然后从Fragment.getActivity().registerReceiver(receiver, filter)
BroadcastReceiver
Fragment
getActivity().registerReceiver(receiver, filter)