当前位置: 首页>>代码示例>>Java>>正文


Java DeleteCallback类代码示例

本文整理汇总了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();
}
 
开发者ID:LibertACAO,项目名称:libertacao-android,代码行数:27,代码来源:EventDetailActivity.java

示例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);
}
 
开发者ID:E2010,项目名称:android-parse-module-titanium-3-5,代码行数:18,代码来源:AndroidTitaniumParseModule.java

示例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);
            }
        });
    }
}
 
开发者ID:SCCapstone,项目名称:diet,代码行数:25,代码来源:SnackList.java

示例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();
}
 
开发者ID:bklimt,项目名称:SurgeTracker,代码行数:17,代码来源:SurgeParseObject.java

示例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;
		}
	});
}
 
开发者ID:INRIX-Iurii-Okhmat,项目名称:ExpertAndroid,代码行数:20,代码来源:WordListAdapter.java

示例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();
            }
        }
    });

}
 
开发者ID:BehrouzRiahu,项目名称:Marketplace,代码行数:14,代码来源:ActivityItemDetails.java

示例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();
                }
            });

        }
    });
}
 
开发者ID:teamOSC,项目名称:Studddinv2_android,代码行数:29,代码来源:MyListingsFragment.java

示例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);
        }
    });
    
}
 
开发者ID:DemocracyLink,项目名称:DemocracyLink-Android,代码行数:15,代码来源:CreateEmailActivity.java

示例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);
        }
    });
}
 
开发者ID:SCCapstone,项目名称:diet,代码行数:35,代码来源:SnackDetailsActivity.java

示例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);
                }
            }
        });
    }
}
 
开发者ID:zonnie,项目名称:Coins,代码行数:31,代码来源:AccountActivity.java

示例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);
}
 
开发者ID:E2010,项目名称:android-parse-module-titanium-3-5,代码行数:5,代码来源:ParseSingleton.java


注:本文中的com.parse.DeleteCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。