package com.example.nuria.fesp_cyl.Opciones;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.util.Log;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.EditText;

import com.example.nuria.fesp_cyl.R;

public class BuscarActivity extends AppCompatActivity {

    private Button buscar;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_buscar);

          buscar = findViewById(R.id.btnBuscar);
        buscar.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                // Code here executes on main thread after user presses button
                setContentView(R.layout.busqueda);
                WebView web = (WebView) findViewById(R.id.busqueda);
                web.loadUrl("http://castillayleon.fespugt.es/component/search/?searchword=&ordering=newest&searchphrase=all&limit=20");

                web.setWebViewClient(new WebViewClient());

                WebSettings webSettings = web.getSettings();
                webSettings.setJavaScriptEnabled(true);

            }
        });
    }
}
