1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 package org.chromium.mojo_shell_apk;
7 import android.app.Activity;
8 import android.content.Intent;
9 import android.os.Bundle;
10 import android.util.Log;
12 import org.chromium.mojo_shell_apk.LibraryLoader;
13 import org.chromium.mojo_shell_apk.MojoMain;
16 * Activity for managing the Mojo Shell.
18 public class MojoShellActivity extends Activity {
19 private static final String TAG = "MojoShellActivity";
22 protected void onCreate(final Bundle savedInstanceState) {
23 super.onCreate(savedInstanceState);
26 LibraryLoader.ensureInitialized();
27 } catch (UnsatisfiedLinkError e) {
28 Log.e(TAG, "libmojo_shell initialization failed.", e);
35 String appUrl = getUrlFromIntent(getIntent());
36 MojoMain.start(this, appUrl);
37 Log.i(TAG, "Mojo started: " + appUrl);
40 private static String getUrlFromIntent(Intent intent) {
41 return intent != null ? intent.getDataString() : null;