Tengo 3 fragments y quiero que en el primero me muestre un WebView el cual contenga un archivo HTML local, hasta ahora he logrado que se muestre un WebView pero en el primer fragment a pesar de que de la programación está hecha en el segundo, cuando intento poner la misma programación en el primer fragment la aplicación se cierra, este el código que tengo en el java del segundo fragment. 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; public class Finformatica2 extends Fragment { public Finformatica2() { // Required empty public constructor } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String url = "file:///android_asset/denominacionInformatica.html"; WebView view = (WebView)getActivity().findViewById(R.id.wView); view.getSettings().setJavaScriptEnabled(true); view.loadUrl(url); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_finformatica2, container, false); } } Este es el código del java del primer fragment 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; public class FInformatica1 extends Fragment { public FInformatica1() { // Required empty public constructor } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_finformatica1, container, false); } } Este es el código del primer fragment <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.example.facien.apliacionfacien.FInformatica1"> <!-- TODO: Update blank fragment layout --> <WebView android:id="@+id/wView" android:layout_width="match_parent" android:layout_height="match_parent" /> </FrameLayout> Este del segundo <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.example.facien.apliacionfacien.Finformatica2"> </FrameLayout> Este es el código Java de la Activity package com.example.facien.apliacionfacien; import android.support.design.widget.TabLayout; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android.os.Bundle; public class InformaticaActivity extends AppCompatActivity implements ActionBar.TabListener, ViewPager.OnPageChangeListener{ /** * The {@link android.support.v4.view.PagerAdapter} that will provide * fragments for each of the sections. We use a * {@link FragmentPagerAdapter} derivative, which will keep every * loaded fragment in memory. If this becomes too memory intensive, it * may be best to switch to a * {@link android.support.v4.app.FragmentStatePagerAdapter}. */ private SectionsPagerAdapter mSectionsPagerAdapter; /** * The {@link ViewPager} that will host the section contents. */ private ViewPager mViewPager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_informatica); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); // Create the adapter that will return a fragment for each of the three // primary sections of the activity. mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) findViewById(R.id.container); mViewPager.setAdapter(mSectionsPagerAdapter); TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs); tabLayout.setupWithViewPager(mViewPager); } // Métodos de la interfaz ActionBar.TabListener @Override public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { mViewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) { } @Override public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) { } // Métodos de la interfaz ViewPager.OnPageChangeListener @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { getSupportActionBar().setSelectedNavigationItem(position); } @Override public void onPageScrollStateChanged(int state) { } /** * A placeholder fragment containing a simple view. public static class PlaceholderFragment extends Fragment { /** * The fragment argument representing the section number for this * fragment. private static final String ARG_SECTION_NUMBER = "section_number"; public PlaceholderFragment() { } /** * Returns a new instance of this fragment for the given section * number. */ /** public static PlaceholderFragment newInstance(int sectionNumber) { PlaceholderFragment fragment = new PlaceholderFragment(); Bundle args = new Bundle(); args.putInt(ARG_SECTION_NUMBER, sectionNumber); fragment.setArguments(args); return fragment; } } */ /** * A {@link FragmentPagerAdapter} that returns a fragment corresponding to * one of the sections/tabs/pages. */ public class SectionsPagerAdapter extends FragmentPagerAdapter { public SectionsPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { Fragment tabFragment = null; switch (position){ case 0: tabFragment = new FInformatica1(); break; case 1: tabFragment = new Finformatica2(); break; case 2: tabFragment = new Finforamtica3(); break; } return tabFragment; } @Override public int getCount() { // Show 2 total pages. return 3; } @Override public CharSequence getPageTitle(int position) { String section = null; switch (position) { case 0: section = "SECTION 1"; break; case 1: section = "SECTION 2"; break; case 2: section = "SECTION 3"; break; } return section; } } } Adicionalmente a eso tengo un tercer fragment, con esta programacio cuando inicia el activity muestra en el primer fragment el WebView, pero cuando me muevo al tercero el WebView desaparece y a pesar de que ponga un WebView en el segundo y tercer fragment solo aparece el del primero.