Questo è per aprire una pagina
codice:
Intent browser = new Intent("android.intent.action.VIEW", Uri.parse("http://www.google.com"));
startActivity(browser);
per la response invece una cosa del genere:
codice:
Intent i = new Intent(context, MyWebViewActivity.class);
i.putExtra('htmlString', tuoResult );
context.startActivity(i);
e nell OnCreate della MyWebViewActivity
codice:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tua_view_che_contiene_una_webview);
WebView webview = (WebView)findViewById(R.id.my_webview);
Bundle extras = getIntent().getExtras();
if(extras != null) {
String htmlString = extras.getString('htmlString');
webview.loadData(htmlString, "text/html", "utf-8");
}
}
dove tuoResult deve derivare da un qualcosa di questo tipo:
codice:
HttpResponse res = client.execute(post);
BasicResponseHandler h= new BasicResponseHandler();
tuoResult = h.handleResponse(res);