Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Unified Diff: sky/apk/demo/org/domokit/sky/demo/SkyDemoActivity.java

Issue 1221123003: SkyDemo should use explicit intents (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/apk/demo/AndroidManifest.xml ('k') | sky/sdk/home.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/apk/demo/org/domokit/sky/demo/SkyDemoActivity.java
diff --git a/sky/apk/demo/org/domokit/sky/demo/SkyDemoActivity.java b/sky/apk/demo/org/domokit/sky/demo/SkyDemoActivity.java
index fcc2a23d018eb93fd6753656d3c8316131a29c4c..0fff47c115ec2c9ba7f360379ed5c8aaa52a17e0 100644
--- a/sky/apk/demo/org/domokit/sky/demo/SkyDemoActivity.java
+++ b/sky/apk/demo/org/domokit/sky/demo/SkyDemoActivity.java
@@ -5,8 +5,6 @@
package org.domokit.sky.demo;
import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
import org.domokit.sky.shell.SkyActivity;
@@ -14,28 +12,17 @@ import org.domokit.sky.shell.SkyActivity;
* Main activity for SkyDemo.
*/
public class SkyDemoActivity extends SkyActivity {
+ private static final String DEFAULT_URL = "https://domokit.github.io/home.dart";
- /**
- * @see android.app.Activity#onCreate(android.os.Bundle)
- */
@Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- String url = "https://domokit.github.io/home.dart";
+ protected void onSkyReady() {
Intent intent = getIntent();
- if (Intent.ACTION_VIEW.equals(intent.getAction())) {
- Uri skyUri = intent.getData();
- Uri httpsUri = skyUri.buildUpon().scheme("https").build();
- // This is a hack to disable https for local testing.
- // getHost may be null if we're passed a non-normalized url.
- if (skyUri.getHost() != null
- && skyUri.getHost().equals("localhost")) {
- httpsUri = skyUri.buildUpon().scheme("http").build();
- }
- url = httpsUri.toString();
- }
+ String action = intent.getAction();
- loadUrl(url);
+ if (Intent.ACTION_MAIN.equals(action)) {
+ loadUrl(DEFAULT_URL);
+ } else if (Intent.ACTION_VIEW.equals(action)) {
+ loadUrl(intent.getDataString());
+ }
}
}
« no previous file with comments | « sky/apk/demo/AndroidManifest.xml ('k') | sky/sdk/home.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698