@Override protected void onCreate(Bundle savedState) { super.onCreate(savedState); setContentView(R.layout.boring_activity_layout); TourHeader header = TourModel.getTour(this).getHeader(); TitleBar titleBar = (TitleBar) findViewById(R.id.boringLayoutTitleBar); titleBar.setTitle(header.getTitle()); LinearLayout rootView = (LinearLayout) findViewById(R.id.boringLayoutRoot); WebView webView = new WebView(this); webView.getSettings().setJavaScriptEnabled(true); HashMap<String, String> content = new HashMap<String, String>(); content.put("BODY-BEFORE-BUTTON", header.getDescriptionTop()); content.put("BODY-AFTER-BUTTON", header.getDescriptionBottom()); String html = StyledContentHTML.populateTemplate(this, "tour/intro_template.html", content); webView.loadDataWithBaseURL(null, html, "text/html", "utf-8", null); rootView.addView(webView); webView.setWebViewClient( new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url.equals("select_start")) { showMap(); } else { CommonActions.viewURL(TourIntroductionActivity.this, url); } return true; } }); }
private void showMap() { Tour tour = TourModel.getTour(); TourMapActivity.launch(this, tour.getDefaultTourMapItems(), tour.getPathGeoPoints(), false); }