Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMOB-16492-New PR with latest master-took care of review comments #5493

Merged
merged 1 commit into from
Mar 19, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
import org.appcelerator.titanium.TiBaseActivity;
import org.appcelerator.titanium.TiContext;
import org.appcelerator.titanium.proxy.ActivityProxy;
import org.appcelerator.titanium.proxy.IntentProxy;
import org.appcelerator.titanium.proxy.RProxy;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;

Expand Down Expand Up @@ -84,6 +86,22 @@ public int getAppVersionCode()
return appVersionCode;
}

@Kroll.getProperty @Kroll.method
public IntentProxy getLaunchIntent()
{
TiApplication app = TiApplication.getInstance();
if (app != null) {
TiBaseActivity rootActivity = app.getRootActivity();
if (rootActivity != null) {
Intent intent = rootActivity.getIntent();
if (intent != null) {
return new IntentProxy(intent);
}
}
}
return null;
}

@Kroll.getProperty
@Kroll.method
public String getAppVersionName()
Expand Down
7 changes: 7 additions & 0 deletions apidoc/Titanium/App/Android/Android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ properties:
permission: read-only
since: 3.3.0

- name: launchIntent
summary: |
Return the intent that was used to launch the application.
type: Titanium.Android.Intent
permission: read-only
since: 3.3.0

examples:
- title: Custom String Resource
example: |
Expand Down