WebView using NumberPicker | Eclipse | Android

Publicado el: 29 octubre 2019
en el canal de: Rayncode
266
1

Join Discord Community:   / discord  

MainActivity.java

NumberPicker np;
Button btn;
WebView wv;

String[] array = { "MyPage", "Google", "Bing", "Yahoo" };
np = (NumberPicker) findViewById(R.id.numberPicker1);
np.setDisplayedValues(array);
np.setMinValue(0);
np.setMaxValue(array.length-1);

wv = (WebView) findViewById(R.id.webView1);
btn =(Button) findViewById(R.id.button1);

btn.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub

int choice = np.getValue();
if(choice == 0)
wv.loadUrl("file:///android_asset/mypage.html");
else if(choice == 1) {

wv.setWebViewClient(new WebViewClient());
wv.loadUrl("https://www.google.com");

}
else if(choice == 2)
wv.loadUrl("https://www.bing.com");
else if(choice == 3)
wv.loadUrl("https://www.yahoo.com");


Source Code: https://github.com/Yaseen549/WebView.git


En esta página del sitio puede ver el video en línea WebView using NumberPicker | Eclipse | Android de Duración hora minuto segunda en buena calidad , que subió el usuario Rayncode 29 octubre 2019, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 266 veces y le gustó 1 a los espectadores. Disfruta viendo!