Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9694] Anvil: jsActivityUrl test in android/android/android test suite fails on Android

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-07-16T15:35:37.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sn/a
ComponentsDrillbit
Labelsanvil, core
ReporterAllen Yeung
AssigneeNeeraj Gupta
Created2012-06-21T11:44:24.000+0000
Updated2017-03-10T00:02:27.000+0000

Description

jsActivityUrl works fine in a test app, but fails in anvil. Here are the contents of the test app: app.js:
		var intent = Ti.Android.createIntent({
			action: Ti.Android.ACTION_MAIN,
			url: 'jsActivity.js'
		});
		intent.addCategory(Ti.Android.CATEGORY_LAUNCHER);
		Ti.Android.currentActivity.startActivityForResult(intent, function(e) {
			Ti.API.info(JSON.stringify(e));
			Ti.API.info("Result Code should be " + Ti.Android.RESULT_OK + " was " + e.resultCode);
		});
jsActivity.js:
var activity = Ti.Android.currentActivity;
activity.addEventListener("create", function(e) {
	activity.setResult(Ti.Android.RESULT_OK);
	activity.finish();
});
Make sure the following entry is in your tiapp.xml
    <android xmlns:android="http://schemas.android.com/apk/res/android">
        <activities>
            <activity url="jsActivity.js"/>
        </activities>
    </android>

Comments

  1. Ping Wang 2012-07-16

    Can not reproduce with 2_1_X branch.
  2. Lee Morris 2017-03-10

    Closing this ticket as the issue cannot be reproduced.

JSON Source