Last active
August 29, 2015 14:05
-
-
Save FrancesTeng/2b5cae74dc25f7775351 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
if (android.os.Build.VERSION.SDK_INT > 9) { | |
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | |
StrictMode.setThreadPolicy(policy); | |
} | |
setContentView(R.layout.show_content_layout); | |
TextView tvTitle = (TextView) findViewById(R.id.title); | |
TextView tvContent = (TextView) findViewById(R.id.content); | |
tvTitle.setText(R.string.title_Loadjson); | |
try { | |
String ret = NetWorkOperaction.requestByHttpGet("http://tongdianer.com/out.json"); | |
NetWorkOperaction.WeatherModel m = NetWorkOperaction.WeatherModel.parse(ret); | |
String content=getResources().getString(R.string.content_Loadjson); | |
tvContent.setText(content+m.weather1); | |
} catch (Exception e) { | |
// TODO Auto-generated catch block | |
Toast.makeText(this, R.string.ToastLoadjson, 1).show(); | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment