簡體   English   中英

如何在Parse.com上放置EditText的內容?

[英]How can I put on Parse.com the content of an EditText?

我正在嘗試創建一個“聯系人”活動,用戶可以在該活動中在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()進行上傳

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM