Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何将EditText的内容放在Parse.com上?_Java_Android_Parse Platform - Fatal编程技术网

Java 如何将EditText的内容放在Parse.com上?

Java 如何将EditText的内容放在Parse.com上?,java,android,parse-platform,Java,Android,Parse Platform,我正在尝试创建一个“联系人”活动,用户可以在EditText小部件上写一些东西,然后按“发送”Parse.com将创建一个文件.txt并将其上传到我的在线解析类中。唯一的问题是我不能告诉脚本“阅读”编辑文本中的内容。让我告诉你: public void send(View view)//this is the onclick "send" button { byte[] data = "text to send".getBytes();// In this way parse.c

我正在尝试创建一个“联系人”活动,用户可以在EditText小部件上写一些东西,然后按“发送”Parse.com将创建一个文件.txt并将其上传到我的在线解析类中。唯一的问题是我不能告诉脚本“阅读”编辑文本中的内容。让我告诉你:

 public void send(View view)//this is the onclick "send" button 
{


    byte[] data = "text to send".getBytes();// In this way parse.com will write "text to send" in the .txt file. Here's the problem: i can't figure out how to tell parse to take what's in the edit text widget and write it inside the .txt.

    ParseFile file = new ParseFile("contact.txt", data);
    file.saveInBackground();

    ParseObject contacts = new ParseObject("Contacts");
    contacts.put("contactName", "File");
    contacts.put("contactResumeFile", file);
    contacts.saveInBackground();
}

有什么想法吗?任何帮助都将被愉快地接受:)

如果您不必将其作为.txt文件上载,您可以使用getText().toString()然后使用saveInBackground()上载它。

您在哪里编辑文本?EditText editabletext;-----oncreate-->editabletext=(EditText)findViewById(R.id.editText2);谢谢,我之前读过这篇评论。我就是这样做的,谢谢