Page 58 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 58
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final WebView webView2 = (WebView)findViewById(R.id.webView2);
Button test1 = (Button) findViewById(R.id.camera1);
Button test2 = (Button) findViewById(R.id.camera2);
Button test3 = (Button) findViewById(R.id.camera3);
View.OnClickListener listener = new View.OnClickListener()
{
@Override
public void onClick (View v)
{
switch (v.getId()) {
case R.id.camera1 :
webView2.setWebViewClient(new WebViewClient());
WebSettings webSettings1 = webView2.getSettings();
webSettings1.setJavaScriptEnabled(true);
webView2.loadUrl("http://192.168.0.14:8081");
break;
case R.id.camera2 :
webView2.setWebViewClient(new WebViewClient());
WebSettings webSettings2 = webView2.getSettings();
webSettings2.setJavaScriptEnabled(true);
webView2.loadUrl("http://192.168.0.14:8082");
break;
case R.id.camera3 :
webView2.setWebViewClient(new WebViewClient());
WebSettings webSettings3 = webView2.getSettings();
webSettings3.setJavaScriptEnabled(true);
webView2.loadUrl("http://192.168.0.14:8083");
break;
- 51 -