private static final String MapTAG = ItemDetailFragment.class.getSimpleName();
[...]
Fragment fMap = getFragmentManager().findFragmentByTag(MapTAG);
if ( fMap == null) fMap = new ItemDetailFragment();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.item_detail_container, fMap, MapTAG);
ft.commit();
While, in your example (ItemDetailActivity.java) the Fragment is re-created on each call of 'onCreate'.
Regards,
Martin
java.io.IOException: lseek failed: EBADF (Bad file number)at java.io.RandomAccessFile.seek(RandomAccessFile.java:606)at org.mapsforge.map.reader.IndexCache.getIndexEntry(IndexCache.java:95)at org.mapsforge.map.reader.MapFile.processBlocks(MapFile.java:512)at org.mapsforge.map.reader.MapFile.readMapData(MapFile.java:341)at org.mapsforge.map.layer.renderer.DatabaseRenderer.executeJob(DatabaseRenderer.java:183)at org.mapsforge.map.layer.renderer.MapWorker.renderTile(MapWorker.java:88)at org.mapsforge.map.layer.renderer.MapWorker.doWork(MapWorker.java:65)at org.mapsforge.map.util.PausableThread.run(PausableThread.java:140)Caused by: libcore.io.ErrnoException: lseek failed: EBADF (Bad file number)at libcore.io.Posix.lseek(Native Method)at libcore.io.ForwardingOs.lseek(ForwardingOs.java:88)at java.io.RandomAccessFile.seek(RandomAccessFile.java:604)... 7 more
i use plain MultiMapDataStore, but have many, many map files. the error occures occationally, after restart the same area is rendered fine. its not related on how long the app is running.
hi,
Am Sonntag, 12. April 2015 22:54:36 UTC+2 schrieb Martin Vennekamp:
java.io.IOException: lseek failed: EBADF (Bad file number)at java.io.RandomAccessFile.seek(RandomAccessFile.java:606)at org.mapsforge.map.reader.IndexCache.getIndexEntry(IndexCache.java:95)at org.mapsforge.map.reader.MapFile.processBlocks(MapFile.java:512)at org.mapsforge.map.reader.MapFile.readMapData(MapFile.java:341)at org.mapsforge.map.layer.renderer.DatabaseRenderer.executeJob(DatabaseRenderer.java:183)at org.mapsforge.map.layer.renderer.MapWorker.renderTile(MapWorker.java:88)at org.mapsforge.map.layer.renderer.MapWorker.doWork(MapWorker.java:65)at org.mapsforge.map.util.PausableThread.run(PausableThread.java:140)Caused by: libcore.io.ErrnoException: lseek failed: EBADF (Bad file number)at libcore.io.Posix.lseek(Native Method)at libcore.io.ForwardingOs.lseek(ForwardingOs.java:88)at java.io.RandomAccessFile.seek(RandomAccessFile.java:604)... 7 more
i have that exact error with 1.5.2rc2 and 1.5.2 still. i use plain MultiMapDataStore, but have many, many map files. the error occures occationally, after restart the same area is rendered fine. its not related on how long the app is running. with 1.5.2rc2 i even had reboots but have no real evidence that this is related.regards, m.
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/7915091c-9cf2-4fda-8507-8a6593611c6c%40googlegroups.com.
I think this can actually happen when you restart the activity (like after purging the cache) because the thread that reads the map file is still active when the map file is closed.
I think this can actually happen when you restart the activity (like after purging the cache) because the thread that reads the map file is still active when the map file is closed.
Could you check if this could be the cause? Also: does your app crash because of this?
the logger is probably from mapsforges, so the have been catched i assume but wasnt?
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/56437D70.4070007%40gmail.com.
...but the app does not terminate?
BTW in latest code the calls start from here.
Can you try with latest 0.6 RC version?
btw: i always see 4 of those stacktraces before the app terminates.
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/06443722-3bba-4235-872c-12aafeb4af75%40googlegroups.com.
The reading and the closing of the file happens on different threads, the exception happens if the closing thread (on the main UI line) runs first, while the reading thread still reads. Thread cancellation is notoriously difficult, but we catch the exception and I do not see why the app should terminate at that point. The exception is caught and ignored.
Usually when you app crashes with some exception you will also see something like an 'unhandled exception' message. This does not seem to be the case here.
Do you run with multiple threads for reading map data? That would explain why you get the message four times. Otherwise I do not think that the reading thread gets rescheduled after the file is closed.
Can you post the full error messages belonging to your apps process id? I think there must be something missing that will give a better hint what is crashing your app. (find out your process id (e.g. 23087) and grep the log on this).
Am Dienstag, 24. November 2015 01:13:36 UTC+1 schrieb Ludwig:The exception is caught and ignored.
may it be an exception during exception processing? especially in difficult states like OOM?
my app catches own exception by Thread.setDefaultUncaughtExceptionHandler(...) - it just logges the exception in there and finishes (see my sample at https://github.com/emdete/ItsDown/blob/master/mapsforge/01.getting_started/src/main/java/org/pyneo/android/gui/Sample.java#L41), may that be the cause?
i use the mapsforge default as far as i know - is it enabled in the 0.6 rc?
On 24/11/2015 07:36 μμ, M. Dietrich wrote:
Am Dienstag, 24. November 2015 01:13:36 UTC+1 schrieb Ludwig:The exception is caught and ignored.
may it be an exception during exception processing? especially in difficult states like OOM?
Actually we catch the exception, but we write it in the log - probably that's what we see.
my app catches own exception by Thread.setDefaultUncaughtExceptionHandler(...) - it just logges the exception in there and finishes (see my sample at https://github.com/emdete/ItsDown/blob/master/mapsforge/01.getting_started/src/main/java/org/pyneo/android/gui/Sample.java#L41), may that be the cause?
Indeed you want to finish the activity at every exception? (even if a library handles it)
BTW search can reveal many opinions about the use of such ways for globally handling exceptions.
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/76a25903-2d7d-4beb-95d7-462130d1537c%40googlegroups.com.
Is this on a real device or an emulator?
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/56560C75.3070402%40gmail.com.
Are you using multiple layers?