Any way of iterating through all views in a view group without knowing their ids?

by Dianne Hackborn » Fri, 13 Feb 2009 03:58:42 GMT

Sponsored Links
 Yes, that is what they are there for.

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.


Other Threads

1. free registration

Social Networking has been effectively used in reaching the goal of
bringing down the prices of costly items through volume shopping. Go
shopping with
FEES!!!!!  DON'T miss this
opportunity, join today for free, and earn more without paying single


2. How to close an activity when the user clicks on home button

Thank you Mark,

I do know that I can you onStop method as it is supposed to be called
when ever something else comes on to the screen (in this case the home
page). But my situation is a little more complicated than that.

I have an address field and an option for gps[if its switched on]. But
in the bottom portion of the screen I will be loading my results based
on the location. Now since I have loaded the results using the
onCreate, its doing so. So I changed it to do all those things in the
onStart method so that the Activity life cycle goes on smoothly.

Thanks for the suggestion because of which I went through my
Activity's lifecycle to see how everything is going on.

But since I started trying to log everything to see the activity life
cycle, what I observed is that onStop method is not actually being
called when I click on home button. Its being called as soon as i open
my app again, which is not how I wanted it to do. The locationUpdates
should stop the moment the user hits home button.

The other thing is that I expected my stack to be as it is and as soon
as I open my app after hitting on home button, the activity which I
was previously in will be opened. But it restarted the app itself.

This is what I observed in my app.
Say I have a main activity A and another Activity B.
I come to Activity B from Activity A.
Then I click on home button.
It closes the app but does not yet call onStop on B.
Now I open my app and it now calls onStop on Activity B.
It starts Activity A again.
Now only when I click on button for activity B, it calls onRestart
method on Activity B.

So am I doing something wrong or is it supposed to work in that way or
is it a bug?


3. bizcard

4. (Gambar di Bajudroid)

5. OnResume() of activity called when pressing the endcall key


7. Set style one by one in TextView