Code example for JSONObject

Methods: optLongoptString

0
        prefs.commit();
 
    } 
 
    protected boolean scheduleSingleNotification(AlarmManager am, JSONObject obj) {
        PendingIntent pendingIntent = createPendingIntentForSchedule(obj.optString("id"));
        long time = obj.optLong("timeMillisSince1970", -1);
        if (time < 0) {
            return false; 
        } 
        am.set(AlarmManager.RTC_WAKEUP, time, pendingIntent);
        return true; 
    } 
 
    public void rescheduleAllNotifications() { 
        long now = System.currentTimeMillis();
        Map<String, ?> map = mPrefs.getAll();
        int count = 0;
        AlarmManager am = (AlarmManager) mContext.getSystemService(Service.ALARM_SERVICE);
        for (Map.Entry<String, ?> entry : map.entrySet()) {
Experience pair programming with AI  Get Codota for Java