mancj / SlideUp-Android

SlideUp is a small library that allows you to add sweet slide effect to any view.
MIT License
1.64k stars 207 forks source link

Issue selecting spinner location #28

Closed shaneherd closed 7 years ago

shaneherd commented 7 years ago

The slide up is working great but I've noticed that in other parts of my app, I can't initialize the selected index of a spinner. The spinner is in an activity which isn't even implementing the SlideUp. I'm performing the following line in an AlertDialog mySpinner.setSelection(7);

The line executes fine, but then when I tell the AlertDialog to show, the app crashes. I then remove your library and everything works fine. I'm not sure how your library could be causing this, but it seems like it is.

Please let me know if there's any more information you need in order to get this resolved.

zTrap commented 7 years ago

@shaneherd Can you show stacktrace?

shaneherd commented 7 years ago

stacktrace.txt

This stacktrace is when I went to a page that has a spinner on it that initializes the selected index to something other than zero. The page doesn't have your slide up implemented on it, but before I added the library and after I removed it, everything worked. The app doesn't crash as soon as it sets the selection. It only seems to happen when the page is being drawn. It appears that the app is trying to render the selected item for the spinner and set the text for it. When it tries to do this, there is a null pointer.

This is how I initialize the adapter for the spinner: SpinnerAdapter adapter = new SpinnerAdapter(context, android.R.layout.simple_spinner_item, source); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter);

zTrap commented 7 years ago

@shaneherd In stacktrace I found no words about our library. I guess this crash was invoked by bug in instant run or somthing else. And re-sync project did helped. To make sure crash is caused by SlideUp try to add library in dependencies again and if it will repeat let us know

shaneherd commented 7 years ago

I'm not using instant run. Also adding the library back in causes the issue to happen again. Like I said before, the issue happens on a page that doesn't include your library which is why it's not included in the stack trace, but removing your library from my project fixes the issue. I really have no idea how your library is tied to the issue.

On Tue, Jun 13, 2017 at 2:36 AM, Peter notifications@github.com wrote:

@shaneherd https://github.com/shaneherd In stacktrace I found no words about our library. I guess this crash was invoked by bug in instant run or somthing else. And re-sync project did help. To make sure crash is caused by SlideUp try to add library in dependencies again and if it will repeat let us know

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mancj/SlideUp-Android/issues/28#issuecomment-308047001, or mute the thread https://github.com/notifications/unsubscribe-auth/AHNlXJNshqmTfBZubVOzfz7v-vu-g1FIks5sDkoFgaJpZM4Nquoh .

zTrap commented 7 years ago

@shaneherd Strange magic... Anyway thanks for your feedback