package com.example.ghomi.chapter11_1;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;

public class MainActivity extends AppCompatActivity {
    WebView wv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    public void onClickWeb(View v){
        wv = (WebView)findViewById(R.id.simpleWebView);
        wv.loadUrl("http://www.olomrayaneh.net");
    }
    public void onClickHtml(View v) {
        wv = (WebView)findViewById(R.id.simpleWebView);
        String customHtml = "<html><body><h1> Androd Studio Book</h1" +
                "<h1> OlomRayaneh Publication </h1><h2 Jafarnejad Ghomi </h2>" +
                "<h3> Application construction </h3>" +
                "<p>This is a sample paragraph of static HTML in web view</p>" +
                "</body></html>";
        wv.loadData(customHtml, "text/html", "UTF-8");
    }
}