Skip to content

Commit

Permalink
Merge pull request #5493 from salachi/TIMOB-16492-New
Browse files Browse the repository at this point in the history
TIMOB-16492-New PR with latest master-took care of review comments
  • Loading branch information
vishalduggal committed Mar 19, 2014
2 parents 7ff8e0b + a634f9b commit a208318
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
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

0 comments on commit a208318

Please sign in to comment.