1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-08 22:51:37 +02:00
Gadgetbridge/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/StopServiceReceiver.java
Andreas Shimokawa 243b9f0a88 Various changes to Service, Activity and Notification handling
- Bluetooth connection is now established in BtSocketIOThread
- Service is now started as soon as the main activity is started
- changed "start service" button to "connect" button
- quit button in service notification now also quits the main activity
- Service notification now displays "Gadgetbride started",
  "connected to Pebble XXXXX" and "not connected" depending on connection state
2015-02-06 13:55:44 +01:00

18 lines
566 B
Java

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);
}
}