@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.boring_activity_layout); TitleBar titleBar = (TitleBar) findViewById(R.id.boringLayoutTitleBar); titleBar.setTitle("Introduction to MIT"); LinearLayout mRoot = (LinearLayout) findViewById(R.id.boringLayoutRoot); WebView contentView = new WebView(this); contentView.setLayoutParams( new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); contentView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); mRoot.addView(contentView); contentView.loadUrl("file:///android_asset/tour/intro_to_mit.html"); }
@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; } }); }
/** ************************************************* */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); String findLoc = null; if (extras != null) { findLoc = extras.getString(KEY_LOCATION); // used by Events: if (extras.containsKey(KEY_LON) && extras.containsKey(KEY_LAT)) { int lon, lat; lon = extras.getInt(KEY_LON); lat = extras.getInt(KEY_LAT); ev_gpt = new GeoPoint(lon, lat); } if (ev_gpt != null) { mMapItems = new ArrayList<MapItem>(); MapItem m = new MapItem(); m.name = title; m.snippets = snippet; mMapItems.add(m); } if (module != null && module.equals(MODULE_SHUTTLE)) { mRouteItem = extras.getParcelable(KEY_ROUTE); } } // Four cases: // // 1 - Events sends LAT/LON // 2 - Stellar sends findLoc query that should yield ONE building // 3 - Map Search sends many buildings // 4 - Shuttle sends many stops center = new GeoPoint(42359238, -71093109); // MIT mListView = (ListView) findViewById(R.id.mapListView); TitleBar titleBar = (TitleBar) findViewById(R.id.mapTitleBar); if (module != null) { if (module.equals(MODULE_SHUTTLE)) { titleBar.setTitle("Route Map"); } } else { titleBar.setTitle("Campus Map"); } if (findLoc == null) { if (mMapItems == null) { mMapItems = loadMapItems(getIntent()); // passed from Browse or Search? if (mMapItems == null) { mMapItems = new ArrayList<MapItem>(); // empty ok } } setOverlays(); } else { doSearch(findLoc); } }