Listener for media button (headset-hook) using service without Activity
问题 How can I make service listen for media button (headset-hook) in android device . I try to do that using this code but did not work. Can you help me. Service code: public class RLservice extends IntentService { private Handler handler; public RLservice() { super("my service"); // TODO Auto-generated constructor stub } @Override public int onStartCommand(Intent intent, int flags, int startId) { handler = new Handler(); return super.onStartCommand(intent, flags, startId); } @Override protected