gpt4 book ai didi

java - 如何将 EditText 的内容放到 Parse.com 上?

转载 作者:行者123 更新时间:2023-11-30 02:04:14 25 4
gpt4 key购买 nike

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

 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() 上传

关于java - 如何将 EditText 的内容放到 Parse.com 上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30976084/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com