felipecsl/QuickReturn

NullPointer in QuickReturnAdapter

Closed this issue · 5 comments

I've come across an error with the adapter using a list view with certain mobile phones.

Genymotion HTC one - API Level 18
sony xperia c5303 - API Level 18
sony xxperia Z1 - API Level 14

java.lang.NullPointerException
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:548)
at android.view.View.measure(View.java:15848)
at com.felipecsl.quickreturn.library.widget.QuickReturnAdapter.getView(QuickReturnAdapter.java:99)

line 99:
v.measure(View.MeasureSpec.makeMeasureSpec( parent.getWidth() / numColumns , View.MeasureSpec.AT_MOST), heightMeasureSpec);

what could be causing the error? It works fine on other phones ive tested i.e nexus 5.

Very sad issue, the same problem on galaxy S3, fine on S5

I'll take a look at this

I've fixed it, now works well on S3. The thing whas that the layoutParams were not explicitly set up before the v.measure() was called.

can you submit a pull request please?

Fixed via #22