There is a Swipe Views with Tabs consists of 3 fragments. I cannot insert WebView into one of the fragments in order to load a local page. 1 problem There is a res / assets folder in it is mypage.html for some reason it writes: invalid resource directory name assets / zTabsViewPager / res line 1 Android AAPT Problem 2 problem The method findViewById (int) / src / com / scorebeyond / android / tabswithswipeexample line 22 Java Problem

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 Fragment1 extends Fragment { WebView myBrowser; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment1, container, false); myBrowser = (WebView)findViewById(R.id.webview); myBrowser.loadUrl("file:///android_asset/mypage.html"); return rootView; } } 

    1 answer 1

    1. Move the assets directory one level higher to the project root.
    2. rootView.findViewById(…)
    • Thank! All of the case. - qwen