dextorer / Sofa

A library for Android TV that extends the Leanback library functionalities
Other
148 stars 34 forks source link

IllegalStateException error #5

Open msh-nayan opened 9 years ago

msh-nayan commented 9 years ago

from Browse Screen, If I Click an Item & then go to another activity (assume, I've another activity name Activity B). When I return to Browse Screen from Activity B by back press, the application goes to force close.

from log cat : ava.lang.RuntimeException: Unable to resume activity : java.lang.IllegalStateException: Item clicked listener must be set before views are created

Caused by: java.lang.IllegalStateException: Item clicked listener must be set before views are created

at .RowsSupportFragment.setOnItemViewClickedListener(RowsSupportFragment.java:158) at .BrowseSupportFragment.onStart(BrowseSupportFragment.java:933)

dkarzon commented 9 years ago

@msh-nayan I actually ran into this same problem. Digging into the source I found that it was caused by the code in BrowseFragment.onStart making a call out to the readd the listeners on start.

I have put a temp fix in my repo https://github.com/dkarzon/Sofa by removing the check. But I'll try to find a better solution and PR it if I can.

philipgiuliani commented 9 years ago

I just came into the same issue when using the library. /cc @dextorer

philipgiuliani commented 9 years ago

@dkarzon Could you quickly explain me how do i use your forked version with gradle?

dkarzon commented 9 years ago

@philipgiuliani There is no package for my fork if that's what you mean.

However you can manually add it to your project. Download it from my fork them put the sofa folder into your source folder. Inside your settings.gradle add this line: include ':sofa'

Then in your app/gradle.build replace your current sofa reference with compile project(':sofa')

philipgiuliani commented 9 years ago

Thanks, thats exactly what i have needed! :+1:

tranxuandat commented 8 years ago

I have the exactly same issue: java.lang.IllegalStateException: Item clicked listener must be set before views are created