1
我試圖創建一個「聯繫人」活動,用戶可以在EditText小部件上編寫一些內容,然後按「發送」,Parse.com將創建一個文件.txt並將其上傳到我的分析類上。唯一的問題是,我實際上無法告訴腳本「閱讀」EditText中的內容。讓我告訴你:如何將Parse.com上的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();
}
有什麼想法?任何幫助將愉快地接受了:)
哪裏是你編輯文本? –
https://parse.com/docs/android/guide – Gunaseelan
EditText editabletext; ---- oncreate ----> editabletext =(EditText)findViewById(R.id.editText2); – Thozzmass