Skip to content

Instantly share code, notes, and snippets.

@stevesohcot
Created May 15, 2016 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevesohcot/6f9551f1c38c81badb8cf82107038995 to your computer and use it in GitHub Desktop.
Save stevesohcot/6f9551f1c38c81badb8cf82107038995 to your computer and use it in GitHub Desktop.
Andoird WebView sample - MainActivity.java
// http://stevesohcot.com/tech-lessons-learned/2016/05/15/android-webview-sample-code/
package com.diamondium.hashtagsaver;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends Activity {
private WebView webview ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webview =(WebView)findViewById(R.id.webView);
webview.setWebViewClient(new WebViewClient());
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setDomStorageEnabled(true);
webview.setOverScrollMode(WebView.OVER_SCROLL_NEVER);
webview.loadUrl("http://hashtagsaver.herokuapp.com/signup");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment