Created
February 12, 2014 21:23
-
-
Save jwhitehorn/8964817 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void render(final String json){ | |
try{ | |
JSONObject jsonObj = new JSONObject(json); | |
Iterator<?> keys = jsonObj.keys(); | |
while(keys.hasNext()){ | |
String key = (String)keys.next(); | |
if(key.equalsIgnoreCase("inCurrencies")){ | |
//TODO | |
}else if(key.equalsIgnoreCase("outCurrencies")){ | |
//TODO | |
}else if(key.equalsIgnoreCase("in_amount")){ | |
((EditText)findViewById(R.id.unconvertedEditText)).setText(jsonObj.getString(key)); | |
}else if(key.equalsIgnoreCase("out_amount")){ | |
((TextView)findViewById(R.id.convertedTextView)).setText(jsonObj.getString(key)); | |
} | |
} | |
}catch(JSONException e){} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment