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


Java ParseObject.saveEventually方法代碼示例

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


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

示例1: createNewNote

import com.parse.ParseObject; //導入方法依賴的package包/類
private void createNewNote(EditText input) {
    Editable value = input.getText();
    adapter.insert(value.toString(), 0);
    note = new ParseObject("ToDoApp");
    note.put("userID",currentUser.get("userID"));
    note.put("note", value.toString());
    note.saveEventually();
    Crouton.makeText(getActivity(), getString(R.string.saved), Style.CONFIRM).show();
}
 
開發者ID:safakesberk,項目名稱:Cloud_Base-To-Do-App,代碼行數:10,代碼來源:MyNotes.java

示例2: sendMessage

import com.parse.ParseObject; //導入方法依賴的package包/類
/**
 * Call this method to Send message to opponent. It does nothing if the text
 * is empty otherwise it creates a Parse object for Chat message and send it
 * to Parse server.
 */
private void sendMessage()
{
	if (txt.length() == 0)
		return;

	InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
	imm.hideSoftInputFromWindow(txt.getWindowToken(), 0);

	String s = txt.getText().toString();
	final Conversation c = new Conversation(s, new Date(),
			UserList.user.getUsername());
	c.setStatus(Conversation.STATUS_SENDING);
	convList.add(c);
	adp.notifyDataSetChanged();
	txt.setText(null);

	ParseObject po = new ParseObject("Chat");
	po.put("sender", UserList.user.getUsername());
	po.put("receiver", buddy);
	// po.put("createdAt", "");
	po.put("message", s);
	po.saveEventually(new SaveCallback() {

		@Override
		public void done(ParseException e)
		{
			if (e == null)
				c.setStatus(Conversation.STATUS_SENT);
			else
				c.setStatus(Conversation.STATUS_FAILED);
			adp.notifyDataSetChanged();
		}
	});
}
 
開發者ID:tamzi,項目名稱:sophia,代碼行數:40,代碼來源:Chat.java

示例3: sendMessage

import com.parse.ParseObject; //導入方法依賴的package包/類
private void sendMessage() {
    String output = "";
    String input = inputText.getText().toString();
    resultDecimal = EmojiParser.parseToHtmlDecimal(input);
    String[] array = input.split(" ");
    Gegram gram = new Parse(array);
    if (!gram.parseBarbarism().equals("no mistake")) {
        System.out.println("Barbarism's index is: " + gram.returnIndex(array));
        array[gram.returnIndex(array)] = gram.returnMatcher();
        System.out.println(gram.parseBarbarism());
    }
    for (int i = 0; i < array.length; i++) {
        System.out.println("array[0]: " + array[0]);
    }
    // System.out.println(resultDecimal);
    //System.out.println(resultHexadecimal);
    Pattern p = Pattern.compile("[^ა-ჰ0-9\\t\\n .,/<>?;:\"'`[email protected]#$€%^&*()_+=|\\\\-]", Pattern.CASE_INSENSITIVE);
    Matcher m = p.matcher(resultDecimal);
    b = m.find();
    if (input.trim().length() > 0 && !b) {
        System.out.println("Yeah! not only spaces,yo?");
        for (int i = 0; i < array.length; i++) {
            output += array[i] + " ";
        }


        final Conversation conversation = new Conversation(output, UserList.user.getUsername(), new Date());
        conversation.setStatus(Conversation.STATUS_SENDING);
        convList.add(conversation);
        adapter.notifyDataSetChanged();
        ParseObject chatobj = new ParseObject("Chat");
        chatobj.put("sender", UserList.user.getUsername());
        chatobj.put("receiver", UserList.nameFromList);
        chatobj.put("message", output);
        chatobj.saveEventually(new SaveCallback() {
            @Override
            public void done(ParseException e) {
                if (e == null) {
                    conversation.setStatus(Conversation.STATUS_SENT);
                } else {
                    System.out.println("ATTENTION! STATUS_FAILED");
                    conversation.setStatus(Conversation.STATUS_FAILED);
                }
                adapter.notifyDataSetChanged();
            }
        });
        System.out.println("output is: " + output);

        /*mFirebaseRef.push().setValue(chat, new Firebase.CompletionListener() {
            @Override
            public void onComplete(FirebaseError firebaseError, Firebase firebase) {
                Log.d(TAG, "onComplete() called with: " + "firebaseError = [" + firebaseError + "], firebase = [" + firebase + "]");
                inputText.setText("");
            }
        });*/

    } else if (b) {
        showDialog(this, "მდგომარეობა", "შეტყობინება არ გაიგზავნა, რადგან თქვენ უცხო ენაზე აკრიფეთ ტექსტი");
        System.out.println("Not sent");
    }
}
 
開發者ID:getsadzeg,項目名稱:mtredi,代碼行數:62,代碼來源:Chat.java


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