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

Crash on Android after closing app with tab group and infinite scroll #48

Open
jvandijk opened this issue Nov 11, 2015 · 10 comments
Open

Comments

@jvandijk
Copy link

I've created an app with a tab group in the root window.

A single tab has infinite scroll logic. When I click the back button to close the app, I experience a crash, but only when using $.is.detach or $.is.cleanup.

It seems the tab group is already doing some cleaning up, because the code is running to an error when trying to execute $.isIndicator.hide()

The log shows the following:

[DEBUG] TabGroup: Tabgroup is closed normally.
[WARN]  TiUIActivityIndicator: (main) [570,8340] Unable to create an activity indicator. Activity is null

Not using the cleanup methods solves the problem, but that's not what you want.

@FokkeZB
Copy link
Collaborator

FokkeZB commented Nov 12, 2015

Probably because cleanup calls detach and detach calls state and state... does stuff with objects already destroyed because you close the tab/app.

The only thing however related to the activity indicator is hiding it:
https://github.com/FokkeZB/nl.fokkezb.infiniteScroll/blob/master/controllers/widget.js#L91

Try commenting out stuff to see if that solves it.

However, I must say I never use cleanup and only use detach if I reached the end and want to get rid of the infinite scroll.

@jvandijk
Copy link
Author

It's the indicator... for sure. But the activity is already gone, because the tabs have no activity themselves.

@FokkeZB
Copy link
Collaborator

FokkeZB commented Nov 12, 2015

And does commenting out the state() call in detach() solve it?

@jvandijk
Copy link
Author

Yep it does... But do you want that?

Verstuurd vanaf mijn iPhone

Op 12 nov. 2015 om 20:41 heeft Fokke Zandbergen [email protected] het volgende geschreven:

And does commenting out the state() call in detach() solve it?


Reply to this email directly or view it on GitHub.

@FokkeZB
Copy link
Collaborator

FokkeZB commented Nov 12, 2015

No, but if you have time and could trace back which line exactly inside state() is causing the crash then we can maybe add a validation to catch the exception.

@jvandijk
Copy link
Author

As I mentioned, it's the $.isIndicator.hide(). The whole activity is already gone so it cannot hide anything anymore. You want to cleanup but maybe leave out the footer related objects.

Verstuurd vanaf mijn iPhone

Op 12 nov. 2015 om 20:46 heeft Fokke Zandbergen [email protected] het volgende geschreven:

No, but if you have time and could trace back which line exactly inside state() is causing the crash then we can maybe add a validation to catch the exception.


Reply to this email directly or view it on GitHub.

@FokkeZB
Copy link
Collaborator

FokkeZB commented Nov 13, 2015

Would you be able to do a PR? I don't have much time to look at it soon.

Topener added a commit that referenced this issue Apr 4, 2017
Making sure UI elements still exists when doing the state function.

Fixing #48
@Topener
Copy link
Owner

Topener commented Apr 4, 2017

@jvandijk would linked PR fix it for you? (I know it is an old issue, but I'd like to know regardless)

@jvandijk
Copy link
Author

jvandijk commented Apr 4, 2017

I can functionally check this somewhere this week. Will keep you updated!

@yankovalera
Copy link

Hi, used latest code but still have an error in Java code, by doing

if (OS_IOS && parentSymbol.footerView === $.is) {
    parentSymbol.footerView = undefined;
}

It works on Android.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants