-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support lib method to launch CC with an App
- Loading branch information
1 parent
6b8f974
commit b57bc5f
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...e-support-library/src/main/java/org/commcare/commcaresupportlibrary/CommCareLauncher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.commcare.commcaresupportlibrary; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
|
||
/** | ||
* Utility class with methods to launch CommCare | ||
*/ | ||
public class CommCareLauncher { | ||
public static final String SESSION_ENDPOINT_APP_ID = "ccodk_session_endpoint_app_id"; | ||
private static final String CC_LAUNCH_ACTION = "org.commcare.dalvik.action.CommCareSession"; | ||
|
||
/** | ||
* | ||
* @param context Android context to launch the CommCare with | ||
* @param appId Unique Id for CommCare App that CommCare should launch with | ||
*/ | ||
public static void launchCommCareForAppId(Context context, String appId) { | ||
Intent intent = new Intent(CC_LAUNCH_ACTION); | ||
intent.putExtra(SESSION_ENDPOINT_APP_ID, appId); | ||
context.startActivity(intent); | ||
} | ||
} |