package com.bwei.test;
import com.bwei.adapter.MyAdapter;
import com.bwei.vo.All;
import com.bwei.vo.Data;
import com.bwei.vo.Show;
import com.google.gson.Gson;
import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest.HttpMethod;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class InfoActivity extends Activity {
private Data data;
private WebView wb;
private String contenttext;
private String id;
private String str = "http://93.gov.cn/93app/info.do?id=";
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_info);
wb = (WebView) findViewById(R.id.wb);
Intent intent = getIntent();
data = (Data) intent.getSerializableExtra("intent");
id = data.getID();
HttpUtils httpUtils = new HttpUtils();
httpUtils.send(HttpMethod.GET, str + id, new RequestCallBack<String>() {
@Override
public void onFailure(HttpException arg0, String arg1) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(ResponseInfo<String> arg0) {
// TODO Auto-generated method stub
Gson gson = new Gson();
Show show = gson.fromJson(arg0.result, Show.class);
contenttext = show.getContenttext();
wb.loadDataWithBaseURL(null, contenttext, "text/html", "utf-8", null);
wb.getSettings().setJavaScriptEnabled(true);
}
});
}
}