I'm trying to show a PDF file saved in Firebase storage using a webview. But the view I'm receiving is blank and grayish at the top only.
public class PerformanceFragment extends Fragment { private WebView webView; private String postUrl = "https://firebasestorage.googleapis.com/v0/b/sas-android-73b28.appspot.com/o/sequence.pdf?alt=media&token=9fc1de4e-1059-4b2b-865e-1c44453a7eb8"; public PerformanceFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View root = inflater.inflate(R.layout.fragment_performance, container, false); webView = root.findViewById(R.id.webView); webView.getSettings().setJavaScriptEnabled(true); webView.loadUrl("http://drive.google.com/viewerng/viewer?embedded=true&url=" + postUrl); webView.setHorizontalScrollBarEnabled(false); webView.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { getActivity().setTitle("Loading..."); getActivity().setProgress(progress * 100); if(progress == 100) getActivity().setTitle(R.string.app_name); } }); return root; } } fragment_performance.xml
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools" tools:context=".PerformanceFragment"> <WebView android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="match_parent" /> </android.support.v4.widget.NestedScrollView> I'm authenticated and yet nothing else is shown.Screenshot is given below: 1
Any help would be appreciated.Thanks.