Comments (13)
If you're seeing this you're probably getting out of memory errors first, if your app is memory intensive then you may want to try adding largeHeap to the android manifest. I had this problem caused by loading up an apk extension file which required the zip decompressor in memory, thus leading to an oom error and then to this.
I think a simple null check here would help too.
from tileview.
I am sure it's not about OOM error. Logcat message clearly shows its a NullPointerException as below
08-23 13:08:22.172: E/AndroidRuntime(22880): FATAL EXCEPTION: AsyncTask
08-23 13:08:22.172: E/AndroidRuntime(22880): java.lang.RuntimeException: An error occured while executing doInBackground()
08-23 13:08:22.172: E/AndroidRuntime(22880): at com.qozix.os.AsyncTask$3.done(AsyncTask.java:276)
08-23 13:08:22.172: E/AndroidRuntime(22880): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
08-23 13:08:22.172: E/AndroidRuntime(22880): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
08-23 13:08:22.172: E/AndroidRuntime(22880): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
08-23 13:08:22.172: E/AndroidRuntime(22880): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
08-23 13:08:22.172: E/AndroidRuntime(22880): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
08-23 13:08:22.172: E/AndroidRuntime(22880): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
08-23 13:08:22.172: E/AndroidRuntime(22880): at java.lang.Thread.run(Thread.java:856)
08-23 13:08:22.172: E/AndroidRuntime(22880): Caused by: java.lang.NullPointerException: key == null || value == null
08-23 13:08:22.172: E/AndroidRuntime(22880): at android.support.v4.util.LruCache.put(LruCache.java:117)
08-23 13:08:22.172: E/AndroidRuntime(22880): at com.qozix.tileview.tiles.TileCache.addBitmapToMemoryCache(TileCache.java:117)
08-23 13:08:22.172: E/AndroidRuntime(22880): at com.qozix.tileview.tiles.TileCache.addBitmap(TileCache.java:72)
08-23 13:08:22.172: E/AndroidRuntime(22880): at com.qozix.tileview.tiles.Tile.decode(Tile.java:75)
08-23 13:08:22.172: E/AndroidRuntime(22880): at com.qozix.tileview.tiles.TileManager.decodeIndividualTile(TileManager.java:308)
08-23 13:08:22.172: E/AndroidRuntime(22880): at com.qozix.tileview.tiles.TileRenderTask.doInBackground(TileRenderTask.java:51)
08-23 13:08:22.172: E/AndroidRuntime(22880): at com.qozix.tileview.tiles.TileRenderTask.doInBackground(TileRenderTask.java:1)
08-23 13:08:22.172: E/AndroidRuntime(22880): at com.qozix.os.AsyncTask$2.call(AsyncTask.java:262)
08-23 13:08:22.172: E/AndroidRuntime(22880): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
08-23 13:08:22.172: E/AndroidRuntime(22880): ... 4 more
from tileview.
Thanks for the note - I'll take a look as soon as I have some time - I probably just missed something when migrating. If you find a fix before then please post.
from tileview.
anyone found the fix?
Thx b4
from tileview.
I just tried and am unable to reproduce - it works fine for me. I suspect there's probably a bad file request (perhaps the result over overly-aggressive intersection detection, which was slightly modified from the previous version).
If either of you @yolapop or @braj008 want to post a problem app somewhere, I'd be interested in taking a look / debugging - otherwise I'd suggest trying the null checks mentioned earlier:
private void addBitmapToMemoryCache( String key, Bitmap bitmap ) {
if ( key == null || bitmap == null ) {
return;
}
if ( getBitmapFromMemoryCache( key ) == null ) {
// crashing here
memoryCache.put( key, bitmap );
}
If that works, post back and I'll update the repo.
Thanks
from tileview.
Worked for me 👯
from tileview.
cool - I've committed the change as well. will leave issue open for a while in case anyone wants to post an app for debug
from tileview.
Above mentioned solution is enough to solve the problem. I have been using following solution.
private void addBitmapToMemoryCache( String key, Bitmap bitmap ) {
if ( getBitmapFromMemoryCache( key ) == null && bitmap != null ) {
memoryCache.put( key, bitmap );
}
}
from tileview.
I would better suggest this fix:
In: DetailLevel in getIntersections function:
Replace
int startingRow = (int) Math.floor( viewport.top / offsetHeight ); int endingRow = (int) Math.ceil( viewport.bottom / offsetHeight ); int startingColumn = (int) Math.floor( viewport.left / offsetWidth ); int endingColumn = (int) Math.ceil( viewport.right / offsetWidth );
By:
int startingRow = (int) Math.floor( viewport.top / offsetHeight ); int endingRow = (int) Math.ceil( viewport.bottom / offsetHeight ) - 1; int startingColumn = (int) Math.floor( viewport.left / offsetWidth ); int endingColumn = (int) Math.ceil( viewport.right / offsetWidth ) - 1;
As tailes are from 0 to n
from tileview.
awesome, big thanks - i'll try this out soon and if it works consistently i'll post a new commit
from tileview.
@Tristus1er solution worked. Shall I close the issue?
from tileview.
@braj008 i'll leave it open as a reminder until i test and commit the patch. thanks
from tileview.
updated in the latest release
from tileview.
Related Issues (20)
- Remote tile demo freezes and crashes HOT 2
- Combine smooth scroll and scale HOT 2
- Tiles not properly laid out when Scale < 1 with remote tiles HOT 15
- Open source but no license? HOT 2
- Markers disappear when zooming HOT 4
- Cannot add tile images on the fly HOT 1
- StreamProvider asked to provide data for rows and columns out of bounds with to small images HOT 5
- Tiles outside the image are created HOT 8
- White text on white background in Advanved Tile Demo HOT 1
- Get touched position when touch on the tileview (version 4.0.7)
- longtouch
- App killed in background crashes when returning to foreground HOT 1
- `android.os.BadParcelableException` regarding `com.moagrius.widget.ScrollView$SavedState.<init>` HOT 1
- Use in viewholder for recycler view. HOT 2
- build() method starts to return void instead of TileView HOT 1
- Mike passed away HOT 5
- Does this lib support SVG format
- JCenter -> MavenCenter
- implementation 'com.qozix:tileview:2.7.7' doesn't seem to work HOT 1
- Impossible import com.qozix.tileview HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tileview.