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-25363] Android: Fix intent URI parsing #9559

Merged
merged 12 commits into from Nov 10, 2017

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews commented Oct 26, 2017

TEST CASE
var win = Ti.UI.createWindow({backgroundColor: 'gray'}),
    btn = Ti.UI.createButton({
	    title: 'SEND',
    });

btn.addEventListener('click', (e) => {
	var img = 'DefaultIcon.png',
	    src = Ti.Filesystem.getFile(img),
	    dst = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, img), //externalStorageDirectory
        intent = Ti.Android.createIntent({
            action: Ti.Android.ACTION_SEND,
            type: 'image/*'
        });

	dst.write(src, false);

	intent.putExtraUri(Ti.Android.EXTRA_STREAM, dst.nativePath);
	intent = Ti.Android.createIntentChooser(intent, 'Choose');
	Ti.Android.currentActivity.startActivity(intent);
});

win.add(btn);
win.open();

JIRA Ticket

@lokeshchdhry
Copy link
Contributor

FR Passed.

No Uncaught No Activity found to handle Intent is thrown.
Also checked with different action types & seems to work as expected.

Studio Ver: 4.10.0.201709271713
SDK Ver: 7.0.0 local build
OS Ver: 10.12.3
Xcode Ver: Xcode 8.3.3
Appc NPM: 4.2.10-2
Appc CLI: 6.3.0-master.15
Ti CLI Ver: 5.0.14
Alloy Ver: 1.10.6
Node Ver: 7.10.1
Java Ver: 1.8.0_101
Devices: ⇨ google Nexus 5 --- Android 6.0.1
⇨ google Pixel --- Android 7.1.1

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: Pass

@jquick-axway
Copy link
Contributor

@lokeshchdhry, please run the sample code attached to TIMOB-25439 as well since this PR fixes it too.

@build
Copy link
Contributor

build commented Oct 26, 2017

Fails
🚫

🔬 There are library changes, but no changes to the unit tests. That's OK as long as you're refactoring existing code, but will require an admin to merge this PR. Please see README.md#unit-tests for docs on unit testing.

Generated by 🚫 dangerJS

@lokeshchdhry
Copy link
Contributor

lokeshchdhry commented Oct 30, 2017

FR passed for changes.

When data is not defined the type is set properly & the app list is shown.

Studio Ver: 4.10.0.201709271713
SDK Ver: 7.0.0 local build
OS Ver: 10.12.3
Xcode Ver: Xcode 8.3.3
Appc NPM: 4.2.10-2
Appc CLI: 6.3.0-master.15
Ti CLI Ver: 5.0.14
Alloy Ver: 1.10.6
Node Ver: 7.10.1
Java Ver: 1.8.0_101
Devices: ⇨ google Nexus 5 --- Android 6.0.1
⇨ google Nexus 6P --- Android 8.0.0

@garymathews
Copy link
Contributor Author

@sgtcoolguy, could you merge this? I can't write unit tests for this change.

@build build added the android label Nov 3, 2017
@lokeshchdhry
Copy link
Contributor

@sgtcoolguy , can you please merge this. @garymathews said in his comment above he can't write unit tests for this PR.

@sgtcoolguy sgtcoolguy merged commit 3b2fb78 into tidev:master Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants