Wednesday, April 27, 2011

[android-developers] Re: Questions about Activity.finish() and a couple of other things.

I am using v2.2 of the SDK.

What I did (in the second paragraph after the code snippet) is to
change the value of the scroller control in the emulator via the UI. I
did not change anything in the debugger. I'm only examine data there.

Why would the activity not appear when it's started? Even if I'm
running outside of the activity itself, wouldn't it show the UI in the
emulator? What would prevent it from showing up?

Yes, System.gc() isn't really a garbage collector operation, it's a
request to the GC to consider doing it if it feels like it (based on
whatever algorithm it uses to perform a garbage collection operation).
The reason I was trying that is because in some other code that we
have here, it seems that objects were not being released, mostly due
to multiple references to the same object. I've cleaned that up so I
could probably remove this call.

Thanks

On Mar 18, 5:42 pm, "A. Elk" <lancaster.dambust...@gmail.com> wrote:
> Certainly testPreConditions() should be executed. Which version of the SDK
> are you using?
>
> As for the Activity not being "finished", I'm not sure what Android does in
> response to mActivity.finish(). I can't really understand what you mean in
> the second paragraph after the code snippet. Seems like you use debug to
> change the values from the ones that were set by the test, and you verify
> that you can see these values in testStateDestroy().
>
> Remember that you're testing the Activity outside of its normal operation. I
> wonder if you *would* see the spinner on the screen, even if the Activity is
> running.
>
> I wouldn't assume that System.gc() does anything useful. The description of
> the method is "Indicates to the virtual machine that it would be a good time
> to run the garbage collector." Not clear to me that the garbage collector is
> what Android uses at the thread/process level, nor is it clear to me that
> Android is inclined to GC apps unless there's severe memory pressure. From
> all I can see, Android wants to keep stuff around if it can. Android
> developers have to learn to "let go", and trust that they can leave their
> app "running".

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate