Sofa icon indicating copy to clipboard operation
Sofa copied to clipboard

IllegalStateException error

Open msh-nayan opened this issue 10 years ago • 6 comments

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)

msh-nayan avatar Sep 11 '15 10:09 msh-nayan

@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.

dkarzon avatar Sep 25 '15 05:09 dkarzon

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

philipgiuliani avatar Nov 02 '15 21:11 philipgiuliani

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

philipgiuliani avatar Nov 03 '15 20:11 philipgiuliani

@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')

dkarzon avatar Nov 03 '15 21:11 dkarzon

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

philipgiuliani avatar Nov 03 '15 21:11 philipgiuliani

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

tranxuandat avatar Aug 04 '16 17:08 tranxuandat