Skip to content

Commit 82bd743

Browse files
author
Devendra
committed
auto restart on crash
1 parent cba769d commit 82bd743

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • android/examples/PubnubSubscribe/src/com/pubnub/examples/pubnubsubscribe

‎android/examples/PubnubSubscribe/src/com/pubnub/examples/pubnubsubscribe/PubnubService.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,18 @@ private void notifyUser(JSONObject message) {
109109
} else {
110110
sendNotification(notification);
111111
}
112+
113+
if (data.equals("crash")) {
114+
// crash now
115+
String s = null;
116+
System.out.println(s.toString());
117+
}
112118
}
113119

120+
public int onStartCommand(Intent intent, int flags, int startId) {
121+
super.onStartCommand(intent, flags, startId);
122+
return START_STICKY;
123+
}
114124

115125
public void onCreate() {
116126
super.onCreate();

0 commit comments

Comments
 (0)