當前位置: 首頁>>代碼示例>>Java>>正文


Java SaveCallback類代碼示例

本文整理匯總了Java中com.parse.SaveCallback的典型用法代碼示例。如果您正苦於以下問題:Java SaveCallback類的具體用法?Java SaveCallback怎麽用?Java SaveCallback使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SaveCallback類屬於com.parse包,在下文中一共展示了SaveCallback類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: send

import com.parse.SaveCallback; //導入依賴的package包/類
protected void send(ParseObject message) {
	message.saveInBackground(new SaveCallback() {
		@Override
		public void done(ParseException e) {
			if (e == null) {
				// success!
				Toast.makeText(RecipientsActivity.this, R.string.success_message, Toast.LENGTH_LONG).show();
				sendPushNotifications();
			}
			else {
				AlertDialog.Builder builder = new AlertDialog.Builder(RecipientsActivity.this);
				builder.setMessage(R.string.error_sending_message)
					.setTitle(R.string.error_selecting_file_title)
					.setPositiveButton(android.R.string.ok, null);
				AlertDialog dialog = builder.create();
				dialog.show();
			}
		}
	});
}
 
開發者ID:NagabhushanS,項目名稱:AmazingFriends,代碼行數:21,代碼來源:RecipientsActivity.java

示例2: saveMethod

import com.parse.SaveCallback; //導入依賴的package包/類
private void saveMethod(){
        //will save the data
        if(dateText.getText().toString().equals("") || dateText.getText().toString().equals(" ") || dateText.getText() == null){  //but before saving we will make sure that date is there
            Toast.makeText(getApplicationContext(), "Attendance date is required",Toast.LENGTH_SHORT).show();
           // Snackbar.make(findViewById(R.id.activity_add_attendance),
                  //  "Attendance date is required", Snackbar.LENGTH_SHORT).show();
        }else{
            List<String> kidsIds = new ArrayList<>();
            for (int i = 0; i < adapter.map.size() ; i++) {
                if (adapter.map.get(kidArrayList.get(i))){
                    kidsIds.add(kidArrayList.get(i).getObjectId());
                }
            }
            attendance.setDate(dateText.getText().toString());
            attendance.setKidsIds(kidsIds);
            attendance.saveInBackground(new SaveCallback() {
                @Override
                public void done(ParseException e) {
                    if (e == null){
                        Toast.makeText(getApplicationContext(),"Saved successfully.",Toast.LENGTH_LONG).show();
                        end();
                    }
                }
            });
        }
}
 
開發者ID:amir511,項目名稱:My-Sheep,代碼行數:27,代碼來源:AddAttendance.java

示例3: incrementNumberOfVisits

import com.parse.SaveCallback; //導入依賴的package包/類
private void incrementNumberOfVisits(){
    int i;
    if(myKid.getNumberOfVisits() == null){
        i = 0;
    }else{
        i = Integer.parseInt(myKid.getNumberOfVisits());}
    i++;
    myKid.setNumberOfVisits(String.valueOf(i));
    myKid.saveInBackground(new SaveCallback() {
        @Override
        public void done(ParseException e) {
        if (e ==  null){
            Toast.makeText(getApplicationContext(),"Saved successfully",Toast.LENGTH_LONG).show();
        }else {
            Toast.makeText(getApplicationContext(),"Error calculating the number of visits!",Toast.LENGTH_LONG).show();
        }
        }
    });
}
 
開發者ID:amir511,項目名稱:My-Sheep,代碼行數:20,代碼來源:KidDetail.java

示例4: start

import com.parse.SaveCallback; //導入依賴的package包/類
@Kroll.method
public void start()
{
    setState(STATE_RUNNING);
    // App opens analytics
    ParseAnalytics.trackAppOpenedInBackground(TiApplication.getAppRootOrCurrentActivity().getIntent());
    ParseInstallation.getCurrentInstallation().put("androidId", getAndroidId());
    ParseInstallation.getCurrentInstallation().saveInBackground(new SaveCallback() {
        public void done(ParseException e) {
            if (e != null) {
                Log.e(TAG, "Installation initialization failed: " + e.getMessage());
            }
            // fire event
            try {
            	JSONObject pnData = new JSONObject();
	pnData.put("objectId", getObjectId());
	pnData.put("installationId", getCurrentInstallationId());
	KrollDict data = new KrollDict(pnData);
             module.fireEvent("installationId", data);
} catch (JSONException e1) {
	Log.e(TAG, "InstallationId event failed: " + e1.getMessage());
}
        }
    });
}
 
開發者ID:gimdongwoo,項目名稱:Titanium-Parse-Android,代碼行數:26,代碼來源:ParseModule.java

示例5: setUpParse

import com.parse.SaveCallback; //導入依賴的package包/類
public static void setUpParse(Context context) {

        Parse.enableLocalDatastore(context);
        Parse.initialize(context, "SUA_APPLICATION_ID", "SUA CLIENT_KEY");
        ParseInstallation.getCurrentInstallation().saveInBackground();

        ParseUser.enableAutomaticUser();
        ParseACL defaultACL = new ParseACL();
        defaultACL.setPublicReadAccess(true);
        defaultACL.setPublicWriteAccess(true);

        ParsePush.subscribeInBackground(Constants.CHANNEL, new SaveCallback() {
            @Override
            public void done(ParseException error) {
                if (error == null) {
                    Log.i(Constants.TAG, "Successfully subscribed to Parse!");
                }else{
                    Log.i(Constants.TAG, "Error subscribed to Parse!");
                }
            }
        });
    }
 
開發者ID:rudsonlive,項目名稱:ParseLiveo,代碼行數:23,代碼來源:ParsePushApp.java

示例6: runUpdate

import com.parse.SaveCallback; //導入依賴的package包/類
private void runUpdate(final Event event, ArrayList<String> locations, String tag) {
    Log.d("FAC", tag);
    for (String location : locations) {
        String venue = event.getVenue();
        venue = venue.replaceAll("\n", " ");
        event.setVenue(venue);

        if (venue.toLowerCase().contains(location)) {
            event.setFacultyTag(tag);
            event.saveInBackground(new SaveCallback() {
                @Override
                public void done(ParseException e) {
                    Log.e("Saved:", event.getType());
                }
            });
            break;
        }
    }
}
 
開發者ID:JavonDavis,項目名稱:UWI-Research-Days-Android,代碼行數:20,代碼來源:EventListFragment.java

示例7: userAcceptedGroup

import com.parse.SaveCallback; //導入依賴的package包/類
private void userAcceptedGroup(Object org){
    if(org instanceof String){
        final Organization newOrg = new Organization((String)org);
        newOrg.saveInBackground(new SaveCallback() {
            @Override
            public void done(ParseException e) {
                if(e == null){
                    //save worked
                    saveAndContinue(newOrg);
                }else{
                    Toast.makeText(CreateOrganization.this, "Error creating organization, please try again", Toast.LENGTH_SHORT).show();
                }
            }
        });
    }else{
        saveAndContinue((Organization)org);
    }

}
 
開發者ID:donniepropst,項目名稱:note.cntxt,代碼行數:20,代碼來源:CreateOrganization.java

示例8: onCreate

import com.parse.SaveCallback; //導入依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();

    Parse.enableLocalDatastore(this);
    Parse.initialize(this, "b6M7rAxtdYoUgGMgGkzmYmpDWiN2T6M8c2RTJ5Zg", "Xsqyd44kUtgiOMMvwP8gyVjmdZLvXLxuynmGqqNX");
    ParsePush.subscribeInBackground("Apro_2016", new SaveCallback() {
        @Override
        public void done(ParseException e) {
            Log.e(TAG, "Successfully subscribed to Parse!");
        }


    });
    Log.d(TAG, "not rgtd.");
}
 
開發者ID:Aparoksha,項目名稱:App_2016,代碼行數:17,代碼來源:parse_config.java

示例9: getFacebookInfo

import com.parse.SaveCallback; //導入依賴的package包/類
private void getFacebookInfo() {
    Bundle parameters = new Bundle();
    parameters.putString("fields", "picture, first_name, id");
    new GraphRequest(AccessToken.getCurrentAccessToken(), "/me", parameters, HttpMethod.GET, new GraphRequest.Callback() {
        @Override
        public void onCompleted(GraphResponse graphResponse) {
            JSONObject user = graphResponse.getJSONObject();
            ParseUser currentUser = ParseUser.getCurrentUser();
            currentUser.put("firstName", user.optString("first_name"));
            currentUser.put("facebookId", user.optString("id"));
            currentUser.put("pictureURL", user.optJSONObject("picture").optJSONObject("data").optString("url"));
            currentUser.saveInBackground(new SaveCallback() {
                @Override
                public void done(ParseException e) {
                    if(e == null) {
                        Log.i(TAG, "User saved");
                        setResult(RESULT_OK);
                        finish();
                    }
                }
            });
        }
    }).executeAsync();
}
 
開發者ID:fadelakin,項目名稱:bitdate,代碼行數:25,代碼來源:SignInActivity.java

示例10: onItemClick

import com.parse.SaveCallback; //導入依賴的package包/類
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
		long id) {
	ImageView checkImageView = (ImageView)view.findViewById(R.id.checkImageView);
	
	if (mGridView.isItemChecked(position)) {
		// add the friend
		mFriendsRelation.add(mUsers.get(position));
		checkImageView.setVisibility(View.VISIBLE);
	}
	else {
		// remove the friend
		mFriendsRelation.remove(mUsers.get(position));
		checkImageView.setVisibility(View.INVISIBLE);
	}
	
	mCurrentUser.saveInBackground(new SaveCallback() {
		@Override
		public void done(ParseException e) {
			if (e != null) {
				Log.e(TAG, e.getMessage());
			}
		}
	});
	
}
 
開發者ID:NagabhushanS,項目名稱:AmazingFriends,代碼行數:27,代碼來源:EditFriendsActivity.java

示例11: activateEvent

import com.parse.SaveCallback; //導入依賴的package包/類
private void activateEvent() {
    new AlertDialog.Builder(this)
            .setTitle(getString(R.string.activate))
            .setMessage(getString(R.string.activateConfirm))
            .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    final ProgressDialog pd = ViewUtils.showProgressDialog(EventDetailActivity.this, getString(R.string.activatingEvent), false);
                    ParseObject eventParseObject = new ParseObject(Event.EVENT);
                    eventParseObject.setObjectId(event.getObjectId());
                    eventParseObject.put(Event.ENABLED, true);
                    eventParseObject.saveInBackground(new SaveCallback() {
                        @Override
                        public void done(ParseException e) {ViewUtils.hideProgressDialog(pd);
                            Toast.makeText(EventDetailActivity.this,
                                    EventDetailActivity.this.getString(R.string.eventActivatedSuccessfully),
                                    Toast.LENGTH_LONG).show();
                            finish();
                        }
                    });
                }
            })
            .setNegativeButton(android.R.string.no, null)
            .setIcon(android.R.drawable.ic_dialog_alert)
            .show();
}
 
開發者ID:LibertACAO,項目名稱:libertacao-android,代碼行數:26,代碼來源:EventDetailActivity.java

示例12: deactivateEvent

import com.parse.SaveCallback; //導入依賴的package包/類
private void deactivateEvent() {
    new AlertDialog.Builder(this)
            .setTitle(getString(R.string.deactivate))
            .setMessage(getString(R.string.deactivateConfirm))
            .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    final ProgressDialog pd = ViewUtils.showProgressDialog(EventDetailActivity.this, getString(R.string.deactivatingEvent), false);
                    ParseObject eventParseObject = new ParseObject(Event.EVENT);
                    eventParseObject.setObjectId(event.getObjectId());
                    eventParseObject.put(Event.ENABLED, false);
                    eventParseObject.saveInBackground(new SaveCallback() {
                        @Override
                        public void done(ParseException e) {ViewUtils.hideProgressDialog(pd);
                            Toast.makeText(EventDetailActivity.this,
                                    EventDetailActivity.this.getString(R.string.eventDeactivatedSuccessfully),
                                    Toast.LENGTH_LONG).show();
                            finish();
                        }
                    });
                }
            })
            .setNegativeButton(android.R.string.no, null)
            .setIcon(android.R.drawable.ic_dialog_alert)
            .show();
}
 
開發者ID:LibertACAO,項目名稱:libertacao-android,代碼行數:26,代碼來源:EventDetailActivity.java

示例13: setupParse

import com.parse.SaveCallback; //導入依賴的package包/類
private void setupParse() {
    Parse.initialize(this, getString(R.string.parse_app_id), getString(R.string.parse_client_key));
    ParseFacebookUtils.initialize(this);
    if(ParseUser.getCurrentUser() != null && !UserPreferences.isUserAssociatedWithInstallation()) {
        // This should be done only once
        ParseInstallation currentInstallation = ParseInstallation.getCurrentInstallation();
        currentInstallation.put("user", ParseUser.getCurrentUser());
        currentInstallation.saveInBackground(new SaveCallback() {
            @Override
            public void done(ParseException e) {
                if(e != null) {
                    Timber.d("Error when trying to associate user with installation: " + e.getLocalizedMessage());
                } else {
                    Timber.d("User successfully associated with installation");
                    UserPreferences.setUserAssociatedWithInstallation();
                }
            }
        });
    }
}
 
開發者ID:LibertACAO,項目名稱:libertacao-android,代碼行數:21,代碼來源:MyApp.java

示例14: removeUserFromRoom

import com.parse.SaveCallback; //導入依賴的package包/類
private void removeUserFromRoom() {
    mRoom.getUsers().remove(mCurrentUser);

    mRoom.saveInBackground(new SaveCallback() {
        @Override
        public void done(ParseException e) {
            if (e == null) {
                setNotRegisteredVisibilityAndStyle();
            } else {
                NotificationHelper.alert(getContext(),
                        getContext().getString(R.string.dialog_error_title),
                        e.getMessage());
            }
        }
    });
}
 
開發者ID:tl-nguyen,項目名稱:RadarApp,代碼行數:17,代碼來源:RoomItem.java

示例15: addUserToRoom

import com.parse.SaveCallback; //導入依賴的package包/類
private void addUserToRoom() {
    mRoom.getUsers().add(mCurrentUser);

    mRoom.saveInBackground(new SaveCallback() {
        @Override
        public void done(ParseException e) {
            if (e == null) {
                setRegisteredVisibilityAndStyle();
            } else {
                setNotRegisteredVisibilityAndStyle();
                NotificationHelper.alert(getContext(),
                        getContext().getString(R.string.dialog_error_title),
                        e.getMessage());
            }
        }
    });
}
 
開發者ID:tl-nguyen,項目名稱:RadarApp,代碼行數:18,代碼來源:RoomItem.java


注:本文中的com.parse.SaveCallback類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。