本文整理汇总了Java中com.parse.DeleteCallback类的典型用法代码示例。如果您正苦于以下问题:Java DeleteCallback类的具体用法?Java DeleteCallback怎么用?Java DeleteCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DeleteCallback类属于com.parse包,在下文中一共展示了DeleteCallback类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteEvent
import com.parse.DeleteCallback; //导入依赖的package包/类
private void deleteEvent() {
new AlertDialog.Builder(this)
.setTitle(getString(R.string.delete))
.setMessage(getString(R.string.deleteConfirm))
.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.deletingEvent), false);
ParseObject eventParseObject = new ParseObject(Event.EVENT);
eventParseObject.setObjectId(event.getObjectId());
eventParseObject.deleteInBackground(new DeleteCallback() {
@Override
public void done(ParseException e) {
DatabaseHelper.getHelper(EventDetailActivity.this).getEventIntegerRuntimeExceptionDao().delete(event);
ViewUtils.hideProgressDialog(pd);
Toast.makeText(EventDetailActivity.this,
EventDetailActivity.this.getString(R.string.eventDeletedSuccessfully),
Toast.LENGTH_LONG).show();
finish();
}
});
}
})
.setNegativeButton(android.R.string.no, null)
.setIcon(android.R.drawable.ic_dialog_alert)
.show();
}
示例2: deleteObject
import com.parse.DeleteCallback; //导入依赖的package包/类
@Kroll.method
public void deleteObject(String className, String objectId, final KrollFunction applicationCallback) {
DeleteCallback parseCallback = new DeleteCallback() {
public void done(ParseException e) {
HashMap result = new HashMap();
if (e == null) {
result.put("success", true);
} else {
result.put("error", e.toString());
}
applicationCallback.callAsync(getKrollObject(), result);
}
};
parseSingleton.DeleteDataObject(className, objectId, parseCallback);
}
示例3: deleteSnack
import com.parse.DeleteCallback; //导入依赖的package包/类
/**
* Deletes a snack entry.
*
* @param position Position of the snack entry to delete
* @param failsafe The failsafe's object id must match the snack entry at the specified position.
* @param callback The callback to invoke after completion.
*/
public void deleteSnack(final int position, final SnackEntry failsafe, final DeleteCallback callback){
SnackEntry toDelete = get(position);
if(!toDelete.getObjectId().equals(failsafe.getObjectId())){
callback.done(new ParseException(ParseException.OTHER_CAUSE, "Invalid delete"));
} else{
get(position).deleteInBackground(new DeleteCallback() {
@Override
public void done(ParseException e) {
if(e == null){
snacks.remove(position);
notifyUpdateComplete(e);
}
callback.done(e);
}
});
}
}
示例4: deleteAsync
import com.parse.DeleteCallback; //导入依赖的package包/类
Task<Void> deleteAsync() {
final Task<Void>.TaskCompletionSource tcs = Task.create();
deleteInBackground(new DeleteCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
logger.log(Level.INFO, "Deleted successfully.");
tcs.setResult(null);
} else {
logger.log(Level.SEVERE, "Unable to delete Surge.", e);
tcs.setError(e);
}
}
});
return tcs.getTask();
}
示例5: deleteWord
import com.parse.DeleteCallback; //导入依赖的package包/类
private void deleteWord(Word wordRef)
{
curWordToDelete = wordRef;
reportBack.reportTransient("Delete Button Clicked:" + wordRef.toString());
reportBack.turnOffProgressDialog();
wordRef.getParseObject().deleteInBackground(new DeleteCallback() {
@Override
public void done(ParseException e) {
reportBack.turnOffProgressDialog();
if (e == null) {
deleteSuccessful(curWordToDelete);
}
else {
deleteFailed(e,curWordToDelete);
}
curWordToDelete = null;
}
});
}
示例6: deleteItem
import com.parse.DeleteCallback; //导入依赖的package包/类
private void deleteItem(ParseObject parseObject) {
parseObject.deleteInBackground(new DeleteCallback() {
@Override
public void done(ParseException e) {
if(e==null){
Toast.makeText(ActivityItemDetails.this, "Post Deleted!!", Toast.LENGTH_LONG).show();
deleted = true;
onBackPressed();
}
}
});
}
示例7: ViewHolder
import com.parse.DeleteCallback; //导入依赖的package包/类
public ViewHolder(CardView v) {
super(v);
this.listing_name = (TextView) v.findViewById(R.id.listing_name);
this.delete = (ImageView) v.findViewById(R.id.listing_delete);
this.createdAt = (TextView) v.findViewById(R.id.listing_created_at);
this.listing_image = (ParseCircularImageView) v.findViewById(R.id.listing_image);
this.listing_desc = (TextView) v.findViewById(R.id.listing_desc);
delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ParseObject object = mDataset.get(getPosition());
object.deleteInBackground(new DeleteCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
mDataset.remove(getPosition());
notifyItemRemoved(getPosition());
notifyItemRangeChanged(getPosition(), mDataset.size());
fetchMyListings();
} else
Toast.makeText(getActivity(), "Please connect to the Internet", Toast.LENGTH_SHORT).show();
}
});
}
});
}
示例8: saveMinistersLocally
import com.parse.DeleteCallback; //导入依赖的package包/类
/**
* Once ministers are retrieved this will save them locally under the name of the province they
* correspond to, or "Canada" if federal.
* @param ministers
*/
private void saveMinistersLocally(final List<ParseObject> ministers) {
ParseObject.unpinAllInBackground(mProvince, ministers, new DeleteCallback() {
@Override
public void done(ParseException e) {
ParseObject.pinAllInBackground(mProvince, ministers);
}
});
}
示例9: deleteEntry
import com.parse.DeleteCallback; //导入依赖的package包/类
private void deleteEntry(){
if(progressOverlay != null)
progressOverlay.setVisibility(View.VISIBLE);
SnackList.getInstance().deleteSnack(snackPosition, snackEntry, new DeleteCallback() {
@Override
public void done(ParseException e) {
if(e == null){
updateToast("Entry deleted", Toast.LENGTH_SHORT);
// Attempt to delete entry's cached image
if(snackEntry != null){
ParseFile parseFile = snackEntry.getPhoto();
if(parseFile != null){
String url = parseFile.getUrl();
if(url != null){
if(fileCache.getFile(url).delete()){
Log.d(TAG, "deleteEntry() successfully deleted entry's cached image");
} else{
Log.d(TAG, "deleteEntry() failed to delete entry's cached image");
}
}
}
}
finish();
} else{
updateToast("Unable to delete entry", Toast.LENGTH_SHORT);
}
if(progressOverlay != null)
progressOverlay.setVisibility(View.GONE);
}
});
}
示例10: deleteAccountTransactions
import com.parse.DeleteCallback; //导入依赖的package包/类
/**
*/
private void deleteAccountTransactions(List<ParseObject> parseObjects)
{
if(parseObjects.isEmpty())
{
setResult(ACCOUNT_DELETED);
finish();
super.showProgress(false);
return;
}
for (ParseObject object : parseObjects)
{
object.deleteInBackground(new DeleteCallback()
{
@Override
public void done(ParseException e)
{
mItemsCounter--;
if (mItemsCounter <= 0)
{
setResult(ACCOUNT_DELETED);
finish();
showProgress(false);
}
}
});
}
}
示例11: DeleteDataObject
import com.parse.DeleteCallback; //导入依赖的package包/类
public void DeleteDataObject(String className, String objectId, DeleteCallback callback) {
ParseObject object = ParseObject.createWithoutData(className, objectId);
object.deleteInBackground(callback);
}