Answer the question
In order to leave comments, you need to log in
How to dynamically change the size of a fragment from a WebView on clicking a button inside a WebView?
We have a fragment inside which the WebView lives:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Context context=getActivity().getApplicationContext();
myFrameLayout=new FrameLayout(context);
viewer =new WebView(context);
viewer.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
myFrameLayout.addView(viewer);
return myFrameLayout;
}
Answer the question
In order to leave comments, you need to log in
developer.android.com/reference/android/webkit/Web...
The addJavascriptInterface() method is what you need. There you can implement any logic.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question