Gadgetbridge/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/StopServiceReceiver.java

18 lines
566 B
Java
Raw Normal View History

package nodomain.freeyourgadget.gadgetbridge;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class StopServiceReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Intent stopIntent = new Intent(context, BluetoothCommunicationService.class);
context.stopService(stopIntent);
Intent quitIntent = new Intent();
quitIntent.setAction(ControlCenter.ACTION_QUIT);
context.sendBroadcast(quitIntent);
}
}