Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void initParse() {
- Log.d(TAG, "initParse");
- Parse.initialize(new Builder(this).server(BuildConfig.SERVER_URL).applicationId(BuildConfig.APP_ID).clientKey(BuildConfig.CLIENT_KEY).enableLocalDataStore().build());
- ParseUser.logInInBackground("blocks", "blocks-emergency", new C07741());
- }
- private void sendNotification(final long timestamp, String serial, String name, Location location, boolean cancelled) {
- Log.d(TAG, "sendNotification t:" + timestamp + " c:" + cancelled);
- Calendar calendar = Calendar.getInstance();
- calendar.setTimeInMillis(timestamp);
- ParseObject notificationObject = new ParseObject(cancelled ? CLASS_EMERGENCY_CANCELLED_NOTIFICATION : CLASS_EMERGENCY_NOTIFICATION);
- notificationObject.put(NOTIFICATION_SERIAL_NUMBER, serial);
- notificationObject.put(NOTIFICATION_NAME, name);
- notificationObject.put(NOTIFICATION_TIME, mFormatter.format(calendar.getTime()));
- notificationObject.put(NOTIFICATION_LOCATION, String.format(getString(C0256R.string.location_format), new Object[]{Double.valueOf(location.getLatitude()), Double.valueOf(location.getLongitude())}));
- notificationObject.saveInBackground(new SaveCallback() {
- public void done(ParseException e) {
- Log.d(MainApplication.TAG, "sendNotification done t:" + timestamp);
- MainApplication.mIsEmergencyOccurred = false;
- MainApplication.mIsEmergencyCancelled = false;
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement