SHARE
TWEET

Untitled

a guest Oct 12th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!-- TODO: Update blank fragment layout -->
  2.  
  3.  
  4. <LinearLayout
  5.     android:layout_width="match_parent"
  6.     android:layout_height="match_parent"
  7.     android:orientation="vertical">
  8.  
  9.  
  10.     <Button
  11.         android:id="@+id/textView2"
  12.         android:layout_width="match_parent"
  13.         android:layout_height="wrap_content"
  14.         android:text="Marlon" />
  15.  
  16.     <WebView
  17.         android:id="@+id/wView"
  18.         android:layout_width="match_parent"
  19.         android:layout_height="100dp">
  20.  
  21.     </WebView>
  22.  
  23. </LinearLayout>
  24.    
  25. package com.example.facien.apliacionfacien;
  26.  
  27. import android.os.Bundle;
  28. import android.support.v4.app.Fragment;
  29. import android.view.LayoutInflater;
  30. import android.view.View;
  31. import android.view.ViewGroup;
  32. import android.webkit.WebView;
  33. import android.widget.Button;
  34. import android.widget.TextView;
  35.  
  36.  
  37. public class FInformatica1 extends Fragment {
  38.  
  39. Button btn1;
  40. WebView wView;
  41. TextView textView2;
  42.  
  43. public FInformatica1() {
  44.     // Required empty public constructor
  45.  
  46.  
  47. }
  48.  
  49. @Override
  50. public void onCreate(Bundle savedInstanceState) {
  51.     super.onCreate(savedInstanceState);
  52.  
  53.     textView2=(Button)findViewById(R.id.textView2);
  54.     wView=(WebView)findViewById(R.id.wView);
  55.  
  56.     textView2.setOnClickListener(new View.OnClickListener() {
  57.         @Override
  58.         public void onClick(View v) {
  59.             wView.setVisibility(View.INVISIBLE);
  60.         }
  61.     });
  62.  
  63.  
  64. }
  65.  
  66. @Override
  67. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  68.                          Bundle savedInstanceState) {
  69.  
  70.     View rootView = inflater.inflate(R.layout.fragment_finformatica1, container, false);
  71.  
  72.     String url = "file:///android_asset/denominacionInformatica.html";
  73.     WebView view = (WebView) rootView.findViewById(R.id.wView);
  74.     view.getSettings().setJavaScriptEnabled(true);
  75.     view.loadUrl(url);
  76.  
  77.     TextView view12 = (TextView) rootView.findViewById(R.id.textView2);
  78.     String ff = "DescripciĆ³n";
  79.     view12.setText(ff);
  80.  
  81.  
  82.     return  rootView;
  83.  
  84. }
  85. }
RAW Paste Data
Top