On 7 June 2012 15:06, Kostya Vasilyev <[email protected]> wrote:
> I remember seeing this in one of my apps in certain cases.
>
> My conclusion was that this might be a bug in strict mode code, and disabled
> it.
>
> Activity orientation changes are processed within a single message loop
> heartbeat, so it's entirely possible that the lifecycles of both activity
> instances overlap.


+1

Setting launchMode to 'singleInstance' can solve this 'issue', as it
will force each (re)created activity to launch in a separate task.
However the wider issue to consider is that
StrictMode.ThreadPolicy.Builder.detectAll() detects *potential*
problems.

The fact that once GCed the activity dissapears, means that it will
get eventually cleared and is not a leak.


Daniel


>
> 2012/6/7 marcin kolonko <[email protected]>
>>
>> ok, i did some memory digging with ddms and memory analizer. and there'
>> s weird behavior:
>>
>> when i run the garbage collector while in portrait mode (still the same
>> case us in first post) and come back to portrait mode, nothing bad happens.
>> the app behaves as it should.
>> when i don't run the garbage collector, the app crashes with the instance
>> count violation error.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Daniel Drozdzewski

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to