MainActivity.java
package com.ingenicotribe.m.androidwebview;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.KeyEvent;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends AppCompatActivity {
private WebView myWebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myWebView = (WebView) findViewById(R.id.webView);
WebSettings webSettings = myWebView.getSettings();
myWebView.setWebViewClient(new WebViewClient());
webSettings.setJavaScriptEnabled(true);
myWebView.loadUrl("http://yourdomain.com");
}
@Override
public void onBackPressed() {
if (myWebView.canGoBack()) {
myWebView.goBack();
} else {
super.onBackPressed();
}
}
}
Great Article
ReplyDeleteAndroid Final Year Project Ideas for Computer Science
Project Centers in Chennai
this is really nice to read..informative post is very good to read..thanks a lot! iPhone Repair Dubai
ReplyDeleteI have read all the comments and suggestions posted by the visitors for this article are very fine,We will wait for your next article so only.Thanks! website
ReplyDeleteThis particular is usually apparently essential and moreover outstanding truth along with for sure fair-minded and moreover admittedly useful My business is looking to find in advance designed for this specific useful stuffs… hoverwatch cost
ReplyDeleteI just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page! android
ReplyDeleteVery informative post ! There is a lot of information here that can help any business get started with a successful social networking campaign ! Asus ZenWatch
ReplyDelete