当前位置: 首页>>代码示例>>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;未经允许,请勿转载。