0
我有 Fragment
,我可以,當我touch Button
關於我 - >移動Fragment
AboutUs;我重複約10次。Android webView InAppBrowserFragment錯誤侵犯菜單
錯誤是相同的圖片。 每個人都可以幫助我嗎?謝謝:
代碼Fragment
負荷WebView
:
public class InAppBrowserFragment
extends BaseFragment {
private static final String LINK_PAGE = "linkPage";
private static final String TITLE_ACTION_BAR = "titleActionBar";
@InjectView(R.id.web_settings)
WebView mWebViewSettings;
@InjectView(R.id.actionbar_settings_sub)
ActionBar mActionBar;
@InjectView(R.id.img__settings_background)
ImageView mImgSettingsBackground;
/**
* Static method used to create an instance for this fragment.
*
* @return New instance of Fragment.
*/
public static InAppBrowserFragment newInstance(String titleActionBar,
String linkPage) {
final InAppBrowserFragment fragment = new InAppBrowserFragment();
final Bundle data = new Bundle();
if (titleActionBar != null) {
data.putString(LINK_PAGE,
linkPage);
data.putString(TITLE_ACTION_BAR,
titleActionBar);
}
// Attach data with fragment.
fragment.setArguments(data);
return fragment;
}
@Override
protected int getLayoutResourceId() {
return R.layout.fragment_in_app_browser;
}
@Override
protected void initUi(final Bundle savedInstanceState) {
String titleActionBar = getArguments().getString(TITLE_ACTION_BAR);
//set background
CommonUtil.displayImage(getActivity(),
CommonUtil.getDrawableResource(R.drawable.img_random_frontpage_1),
this.mImgSettingsBackground,
0,
0,
0,
true,
false,
null);
//set UI Action Bar
this.mActionBar.setupUI(null,
titleActionBar,
R.drawable.ab_ic_back,
0,
"");
this.mActionBar.setButtonRightPadding(0);
this.mActionBar.setButtonLeftListener(new ActionBar.IActionBarButtonLeftListener() {
@Override
public void onButtonLeftClicked(final View view) {
popBack(true);
mWebViewSettings.canGoBack();
}
});
}
@Override
protected void loadData(final Bundle savedInstanceState) {
String linkPage = getArguments().getString(LINK_PAGE);
// Init webview setting
WebSettings settings = mWebViewSettings.getSettings();
settings.setJavaScriptEnabled(true);
settings.setBuiltInZoomControls(true);
settings.setDisplayZoomControls(true);
settings.setSupportZoom(true);
mWebViewSettings.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
public void onPageFinished(WebView view, String url) {
}
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
}
});
mWebViewSettings.loadUrl(linkPage);
}
}
Conrect:
Inconrect: