Friday, 15 January 2010

android - Back button very slow -



android - Back button very slow -

i have android app tabactivity holding 4 tabs - list view, map view, list , webview. list view can tap item , starts activity, pressing returns tab activity.

however, 1 time map view tab has been visited, navigating sec activity list view , pressing button results in hang of 3-4 seconds. 1 time map view has been visited, problem never goes away until app exited.

some more notes:

the map view can launch activity - , in case button works fine - it's if map view tab inactive when sec activity launched problem occurs. testing on 2 devices - problem occurs on galaxy s, doesn't occur on nexys 7. there's nil obvious in logcat can see. app using maps api v2, , back upwards lib fragment support. app written in mono.

more info. set in log messages on map activity it's lifecycle events:

switching away map tab:

02-12 18:53:43.841 i/maptest ( 5031): onsaveinstancestate 02-12 18:53:43.857 i/maptest ( 5031): onpause

launching sec activity list view tab:

02-12 18:54:06.900 i/maptest ( 5031): onsaveinstancestate virtual void webcore::widget::show() virtual void webcore::widget::show() void webcore::scriptcontroller::updateplatformscriptobjects() virtual void webcore::widget::show() static bool webcore::resourcehandle::supportsbuffereddata() static bool webcore::resourcehandle::supportsbuffereddata() 02-12 18:54:07.353 i/maptest ( 5031): onstop

pressing button sec activity (ie: when pause occurs):

-- absolutely nil in log cat --

switching map tab:

02-12 18:54:59.056 i/maptest ( 5031): onrestart 02-12 18:54:59.060 i/maptest ( 5031): onstart 02-12 18:54:59.064 i/maptest ( 5031): onresume

what might cause returning activity block 3-4 seconds?

alternatively, more can diagnose this?

more info:

as per michal-z's comment, profiled under ddms , of time beingness spent in message dispatching, layout , drawing... i'm suspicious of sort of recursive layout or drawing issue...

also, tried removing map fragment when map activity stopped , adding when map activity started , resolved delay problem, map doesn't remember it's state, looses it's markers , it's slow reappear.

another follow up:

the only solution find remove fragment when activity stopped , add together when resumed - , saving photographic camera position. tried hiding , re-showing fragment both through fragment manager , straight on map view - no luck.

android android-tabhost android-support-library android-maps-v2

No comments:

Post a Comment