Back to project page openPDS-HelloWorld.
The source code is released under:
MIT License
If you think the Android project openPDS-HelloWorld listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package edu.mit.media.hellopds; //from w w w . ja v a 2 s .com import android.app.Activity; import android.support.v4.view.ViewPager; import android.webkit.JavascriptInterface; public class WebViewFragmentJavascriptInterface { protected ViewPager mViewPager; protected Activity mActivity; public WebViewFragmentJavascriptInterface(ViewPager viewPager, Activity activity) { mViewPager = viewPager; mActivity = activity; } @JavascriptInterface public boolean hideWebNavBar() { return true; } @JavascriptInterface public boolean handleTabChange(final String dimension, final int tabNumber) { if (mActivity != null && mViewPager != null) { mActivity.runOnUiThread(new Runnable() { @Override public void run() { mViewPager.setCurrentItem(tabNumber + 1); } }); } return true; } }