public boolean loadIntent(Intent intent) { String action = intent.getAction(); if (Intent.ACTION_RUN.equals(action)) { mView.getEngine().runFromBundle(intent.getDataString()); String route = intent.getStringExtra("route"); if (route != null) mView.getEngine().pushRoute(route); return true; } return false; }
@Override protected void onPause() { super.onPause(); if (mView != null) { mView.getEngine().onActivityPaused(); } }
/** Override this function to customize startup behavior. */ protected void onSkyReady() { TraceEvent.instant("SkyActivity.onSkyReady"); Locale locale = getResources().getConfiguration().locale; mView.getEngine().onLocaleChanged(locale.getLanguage(), locale.getCountry()); if (loadIntent(getIntent())) { return; } File dataDir = new File(PathUtils.getDataDirectory(this)); File appBundle = new File(dataDir, SkyApplication.APP_BUNDLE); if (appBundle.exists()) { mView.getEngine().runFromBundle(appBundle.getPath()); return; } }
@Override protected void onPostResume() { super.onPostResume(); if (mView != null) { mView.getEngine().onActivityResumed(); } }
/** Override this function to customize startup behavior. */ protected void onSkyReady() { if (loadIntent(getIntent())) { return; } File dataDir = new File(PathUtils.getDataDirectory(this)); File snapshot = new File(dataDir, SkyApplication.SNAPSHOT); if (snapshot.exists()) { mView.getEngine().runFromSnapshot(snapshot.getPath()); return; } File appBundle = new File(dataDir, SkyApplication.APP_BUNDLE); if (appBundle.exists()) { mView.getEngine().runFromBundle(appBundle.getPath()); return; } }
@Override public void onBackPressed() { if (mView != null) { mView.getEngine().popRoute(); return; } super.onBackPressed(); }
public boolean loadBundleByName(String name) { File dataDir = new File(PathUtils.getDataDirectory(this)); File bundle = new File(dataDir, name); if (!bundle.exists()) { return false; } mView.getEngine().runFromBundle(bundle.getPath()); return true; }
@Override public void onBackPressed() { if (mView != null) { InputEvent event = new InputEvent(); event.type = EventType.BACK; mView.getEngine().onInputEvent(event); return; } super.onBackPressed(); }
public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); Locale locale = getResources().getConfiguration().locale; mView.getEngine().onLocaleChanged(locale.getLanguage(), locale.getCountry()); }
public void loadUrl(String url) { mView.getEngine().runFromNetwork(url); }