You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2012/06/08 20:03:47 UTC

[1/4] android commit: Adding getContext, startActivity to CordovaInterface

Updated Branches:
  refs/heads/master 80a5ea137 -> 95b48705f


Adding getContext, startActivity to CordovaInterface


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/95b48705
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/95b48705
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/95b48705

Branch: refs/heads/master
Commit: 95b48705fea2cac0f2561f84d3f1ecf017357b58
Parents: 6c1a2e1
Author: macdonst <si...@gmail.com>
Authored: Fri Jun 8 14:03:20 2012 -0400
Committer: macdonst <si...@gmail.com>
Committed: Fri Jun 8 14:03:20 2012 -0400

----------------------------------------------------------------------
 .../org/apache/cordova/api/CordovaInterface.java   |   25 ++++++++++-----
 1 files changed, 17 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/95b48705/framework/src/org/apache/cordova/api/CordovaInterface.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/api/CordovaInterface.java b/framework/src/org/apache/cordova/api/CordovaInterface.java
index fa6e1f8..0242aa7 100755
--- a/framework/src/org/apache/cordova/api/CordovaInterface.java
+++ b/framework/src/org/apache/cordova/api/CordovaInterface.java
@@ -19,6 +19,7 @@
 package org.apache.cordova.api;
 
 import android.app.Activity;
+import android.content.Context;
 import android.content.Intent;
 
 /**
@@ -28,9 +29,9 @@ import android.content.Intent;
 public interface CordovaInterface {
 
     /**
-     * Launch an activity for which you would like a result when it finished. When this activity exits, 
+     * Launch an activity for which you would like a result when it finished. When this activity exits,
      * your onActivityResult() method will be called.
-     *  
+     *
      * @param command     The command object
      * @param intent      The intent to start
      * @param requestCode   The request code that is passed to callback to identify the activity
@@ -38,29 +39,36 @@ public interface CordovaInterface {
     abstract public void startActivityForResult(IPlugin command, Intent intent, int requestCode);
 
     /**
+     * Launch an activity for which you would not like a result when it finished.
+     *
+     * @param intent            The intent to start
+     */
+    abstract public void startActivity(Intent intent);
+
+    /**
      * Set the plugin to be called when a sub-activity exits.
-     * 
+     *
      * @param plugin      The plugin on which onActivityResult is to be called
      */
     abstract public void setActivityResultCallback(IPlugin plugin);
 
     /**
      * Causes the Activity to override the back button behavior.
-     * 
+     *
      * @param override
      */
     public abstract void bindBackButton(boolean override);
 
     /**
      * A hook required to check if the Back Button is bound.
-     * 
+     *
      * @return
      */
     public abstract boolean isBackButtonBound();
 
     /**
      * Get the Android activity.
-     * 
+     *
      * @return
      */
     public abstract Activity getActivity();
@@ -69,12 +77,13 @@ public interface CordovaInterface {
     public abstract void cancelLoadUrl();
 
     /**
-     * Called when a message is sent to plugin. 
-     * 
+     * Called when a message is sent to plugin.
+     *
      * @param id            The message id
      * @param data          The message data
      * @return              Object or null
      */
     public Object onMessage(String id, Object data);
 
+    abstract public Context getContext();
 }