Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pl.tropikana24.ljagoda.zad3;
- import android.content.Intent;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.webkit.WebView;
- public class web_view_ extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_web_view_);
- Intent intent = getIntent();
- WebView webView = (WebView) findViewById(R.id.webView);
- webView.getSettings().setJavaScriptEnabled(true);
- if (intent.hasExtra("url")) {
- webView.loadUrl(intent.getStringExtra("url"));
- }
- if (intent.hasExtra("info")) {
- String customHtml = intent.getStringExtra("info");
- webView.loadData(customHtml, "text/html", null);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement