我有我的應用程序從鏈接獲取JSON數據,但我需要從JSON獲取狀態。JSON到textView?
- Status> Code and Msg。
這裏是我的工作:
截圖:
我需要把它輸出>
- 代碼:成功(或失敗,無論json說)
- Msg:許可更新..(或任何J SON吐出)
任何幫助會很好,或指示我的方向,謝謝。
我的一些代碼:
public class doit extends AsyncTask<Void,Void,Void>{
String words;
public doit() throws JSONException {
}
@Override
protected Void doInBackground(Void... voids) {
try {
WebView wv = (WebView) findViewById(R.id.webview);
EditText messages = (EditText) findViewById(R.id.messages);
Document doc = Jsoup.connect("https://api.deepbot.tv/web/apply/namerefresh.php?s=" + messages.getText().toString()).get();
words=doc.text();
}catch(Exception e){e.printStackTrace();}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
texx.setText(words);
}
評論不適合廣泛的討論;這個對話已經[轉移到聊天](http://chat.stackoverflow.com/rooms/146440/discussion-on-answer-by-nilesh-rathod-json-to-textview)。 –