本文整理汇总了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();
}
示例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();
}
});
}
示例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");
}
}