Skip to content

Commit

Permalink
Added StopService Method.
Browse files Browse the repository at this point in the history
  • Loading branch information
canewsin committed Oct 28, 2020
1 parent d229f1d commit ed0a60e
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 603 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
.pub/

build/
pubspec.lock
.idea/
19 changes: 0 additions & 19 deletions .idea/libraries/Dart_SDK.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/runConfigurations/example_lib_main_dart.xml

This file was deleted.

45 changes: 0 additions & 45 deletions .idea/workspace.xml

This file was deleted.

1 change: 0 additions & 1 deletion android/.idea/.name

This file was deleted.

Binary file removed android/.idea/caches/build_file_checksums.ser
Binary file not shown.
134 changes: 0 additions & 134 deletions android/.idea/codeStyles/Project.xml

This file was deleted.

20 changes: 0 additions & 20 deletions android/.idea/gradle.xml

This file was deleted.

25 changes: 0 additions & 25 deletions android/.idea/jarRepositories.xml

This file was deleted.

9 changes: 0 additions & 9 deletions android/.idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions android/.idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions android/.idea/runConfigurations.xml

This file was deleted.

6 changes: 0 additions & 6 deletions android/.idea/vcs.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result
return;
}

if (method.equalsIgnoreCase("stopService")) {
Intent intent = new Intent(this, WatchdogReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 1253, intent, 0);
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
alarmManager.cancel(pendingIntent);
stopSelf();
result.success(true);
return;
}

if (method.equalsIgnoreCase("sendData")){
LocalBroadcastManager manager = LocalBroadcastManager.getInstance(this);
Intent intent = new Intent("id.flutter/background_service");
Expand Down
Loading

0 comments on commit ed0a60e

Please sign in to comment.