Notas: He quitado el mensaje
- He quitado el mensaje de error, porque ahora no muestra ninguno
- He cambiado ImageButton por Button, Del código botonRetraso1 = (Button) rootView.findViewById(R.id.btRetraso1); he eliminado (Button) parece que es innecesario.
Código de error, porque ahora no muestra ninguno He cambiado ImageButtonRetrasos1.java por
public class Retrasos1 extends Fragment {
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
private String mParam1;
private String mParam2;
WebView mWebView;
private OnFragmentInteractionListener mListener;
public Retrasos1() {
}
public static Retrasos newInstance(String param1, String param2) {
Retrasos1 fragment = new Retrasos1();
Bundle args = new Bundle();
args.putString( ARG_PARAM1, param1 );
args.putString( ARG_PARAM2, param2 );
fragment.setArguments( args );
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
if (getArguments() != null) {
mParam1 = getArguments().getString( ARG_PARAM1 );
mParam2 = getArguments().getString( ARG_PARAM2 );
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate( R.layout.retrasos1, container, false );
mWebView = view.findViewById(R.id.webView1 );
mWebView.getSettings().setJavaScriptEnabled( true );
mWebView.getSettings().setAppCacheEnabled( true );
mWebView.getSettings().setBuiltInZoomControls( true );
mWebView.getSettings().setDisplayZoomControls( false );
mWebView.getSettings().setSupportZoom( true );
mWebView.getSettings().setDefaultZoom( WebSettings.ZoomDensity.FAR );
mWebView.getSettings().setLoadWithOverviewMode( true );
mWebView.getSettings().setUseWideViewPort( true );
mWebView.setInitialScale(1);
mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
mWebView.setScrollbarFadingEnabled(false);
mWebView.loadUrl( "https://www.google.es/" );
return view;
}
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
public interface OnFragmentInteractionListener {
void onFragmentInteraction(Uri uri);
}
}
Buttonretrasos1.xml,
Del código botonRetraso1 = (Button) rootView.findViewById(R.id.btRetraso1); he eliminado (Button) parece que es innecesario.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.SoCu.CirDocu.Retrasos1">
<WebView
android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>