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-24253] Android: onBackPressed() validate topWindow before hasProperty() #8796

Merged
merged 1 commit into from Jan 26, 2017

Conversation

garymathews
Copy link
Contributor

  • Prevent intermittent crash when topWindow is null
TEST CASE
var win = Titanium.UI.createWindow();
var imageView = Ti.UI.createImageView({
    height: Ti.UI.FILL,
    width: Ti.UI.FILL
});
 
var btn = Ti.UI.createButton({
    title: "Cam"
});
win.add(btn);
 
var overlay = Ti.UI.createView({});
var btn2 = Ti.UI.createButton({
    title: "take image"
});
btn2.addEventListener("click",function(e){
    Ti.Media.takePicture();
})
overlay.add(btn2)
 
btn.addEventListener("click", function(e) {
    console.log("----------------------------start camera------------------------");
    Titanium.Media.showCamera({
        overlay: overlay,
        success: function(event) {
              imageView.image = f.nativePath;
        },
        cancel: function() {     Ti.API.info('#### Camera Cancel');    },
        error: function(error) {},
        allowEditing: true
    });
})
win.add(imageView);
win.addEventListener("open", function() {
 
});
win.open();

JIRA Ticket

@lokeshchdhry
Copy link
Contributor

lokeshchdhry commented Jan 26, 2017

FR passed.
Checked with the code above. Fix looks good. The app does not crash after we return back to the app from an androidback event.
Also, checked the original issue & works well.

Appc Studio : 4.8.1.201612050850
Mac OS Version : 10.12.2
Xcode Version : Xcode 8.2.1 Build version 8C1002
Appc CLI AND Appc NPM : {"NPM":"4.2.9-1","CLI":"6.1.0"}
Ti CLI : 5.0.11
Alloy : 1.9.5
Node : v4.6.0

@lokeshchdhry lokeshchdhry merged commit 1bc75f9 into tidev:master Jan 26, 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

2 participants