TiTouchGallery
TiTouchGallery copied to clipboard
Image cannot be loaded in Andorid L 5.0
The module works fine on Android 4.4.4 and before. But it does not work properly on Android L 5.0. The images are loaded for the first time but if you close the image page and open it again (with the same http request), it will give the following error. This happens even after we close the app and reopen it.
[WARN] : W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference
[WARN] : W/System.err: at com.android.okhttp.internal.http.StatusLine.
any fixes or hints?
Thanks a lot
It seems this issue was caused by caching. A temporary fix would be disable the caching in UrlTouchImageView.java:
URL aURL = new URL(url);
URLConnection conn = aURL.openConnection();
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP )
conn.setUseCaches(false);
This is caused by a bug in the implementation of TiCacheResponse. See: https://code.google.com/p/android/issues/detail?id=160522
Hi,can anyone temporary disable the cache then compile to module zip fike and send it to me? my ant build compile error
Dirty workaround: I have added a '?_=' + Mat.random() to every URL and it works for me. i know, it is very dirty, but it works. I suppose a new propetty 'nocache'
The issue is here: http://stackoverflow.com/questions/29072951/httpurlconnection-failes-with-nullpointerexception-on-lollipop
Here is a compiled version: https://github.com/AppWerft/DLRmediathek/blob/master/com.gbaldera.titouchgallery.zip?raw=true Currently I don't know how I can pullrequest. In my version 1.2 I have supressed caching.
If you build titanium yourself, you can get my fix to TiResponseCache from here: https://www.dropbox.com/s/z814rg68p8qz7ew/TiResponseCache.java?dl=0
This should be fixed now with the latest Ti SDK 4.1.0+