Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- TODO: Update blank fragment layout -->
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
- <Button
- android:id="@+id/textView2"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="Marlon" />
- <WebView
- android:id="@+id/wView"
- android:layout_width="match_parent"
- android:layout_height="100dp">
- </WebView>
- </LinearLayout>
- package com.example.facien.apliacionfacien;
- import android.os.Bundle;
- import android.support.v4.app.Fragment;
- import android.view.LayoutInflater;
- import android.view.View;
- import android.view.ViewGroup;
- import android.webkit.WebView;
- import android.widget.Button;
- import android.widget.TextView;
- public class FInformatica1 extends Fragment {
- Button btn1;
- WebView wView;
- TextView textView2;
- public FInformatica1() {
- // Required empty public constructor
- }
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- textView2=(Button)findViewById(R.id.textView2);
- wView=(WebView)findViewById(R.id.wView);
- textView2.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- wView.setVisibility(View.INVISIBLE);
- }
- });
- }
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View rootView = inflater.inflate(R.layout.fragment_finformatica1, container, false);
- String url = "file:///android_asset/denominacionInformatica.html";
- WebView view = (WebView) rootView.findViewById(R.id.wView);
- view.getSettings().setJavaScriptEnabled(true);
- view.loadUrl(url);
- TextView view12 = (TextView) rootView.findViewById(R.id.textView2);
- String ff = "Descripción";
- view12.setText(ff);
- return rootView;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement