Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TranslatedWord trWord=new TranslatedWord();
- @Override
- protected void onPostExecute(JSONObject json) {
- try {
- JSONArray result = json.getJSONArray(TAG_RESULTS);
- String text = result.getString(0); //Catched string here
- trWord.setTranslatedWord(text);
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
- public class TranslatedWord {
- private String trWord;
- public void setTranslatedWord(String trWord) {
- this.trWord = trWord;
- }
- public String getTrWord() {
- return trWord;
- }
- public void setTrWord(String trWord) {
- this.trWord = trWord;
- }
- }
- String translatedWord = trWord.getTrWord();
Add Comment
Please, Sign In to add comment