Skip to content

Commit 9c84fa5

Browse files
committed
nicer way to generate json string
1 parent d644083 commit 9c84fa5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

example/android_source/src/org/kviktor/example/ExampleActivity.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ public static String sendNotification(String data) {
6969
m_notificationManager.notify(1, notification);
7070

7171
Log.i(TAG, "sendNotification finished");
72-
return "{\"json_key\":5}";
72+
73+
try {
74+
return new JSONObject().put("success", true).toString();
75+
} catch(JSONException e) {
76+
// should really not happen
77+
return "{}";
78+
}
7379
}
7480
}

0 commit comments

Comments
 (0)