Ver Mensaje Individual
  #3  
Viejo 10/03/14, 09:56:55
Array

[xs_avatar]
Napster87 Napster87 no está en línea
Miembro del foro
 
Fecha de registro: may 2013
Mensajes: 74
Tu operador: Movistar

Gracias por la idea,asi si lo he conseguido hacer funcionar

Dejo el codigo por si le vale a alguien en un futuro:

[code]public void LectorQR(View v) {

Intent intent = new Intent("prueba.android.turismo.SCAN");
startActivityForResult(intent, 0);

}



public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == 0) {
if (resultCode == RESULT_OK) {
String contenido = intent.getStringExtra("SCAN_RESULT");
String formato = intent.getStringExtra("SCAN_RESULT_FORMAT");
Intent i = new Intent(this, LectorQR.class);
i.putExtra("contenido", contenido);
startActivity(i);

// Hacer algo con los datos obtenidos.
} else if (resultCode == RESULT_CANCELED) {
// Si se cancelo la captura.
}
}
}

Y en clase LectorQR,en oncreate:
Código:
  WebView myWebViewDATOS = (WebView) findViewById(R.id.webViewQR);
		 myWebViewDATOS.getSettings().setJavaScriptEnabled(true);
	        
		 
	        /* Prevent WebView from Opening the Browser */
		 myWebViewDATOS.setWebViewClient(new InsideWebViewClient());
		 myWebViewDATOS.loadUrl(bundle.getString("contenido"));
			
	    }
	    
	    /* Class that prevents opening the Browser */
	    private class InsideWebViewClient extends WebViewClient {
	        @Override
	        public boolean shouldOverrideUrlLoading(WebView view, String url) {
	            view.loadUrl(url);
	            return true;
	        }
	    }
Con esto funciona a la perfeccion,espero que le sirva a alguien.Sencillo y eficaz jeje

Última edición por Napster87 Día 10/03/14 a las 12:01:33.
Responder Con Cita