I dont understand why everyone makes this so complicated.
First of all, this is a phone, you don't want to be using tons of data
structures. There is nothing wrong with some global variables/
functions.
If you want to store data that will be shared between activities, just
simply use a static
thanks, I feel a bit over complicate and bug-prone to manage views
manually via setContentView, so I simply changed the architecture,
putting the common classes of interest in a singleton (luckily this
solution fits with my app design). This way I can decouple the
activities and keep a common
Another way you can use to share common data between activities is
having it in the Application's instance. Just create your own
Application - derived class, tell Android via manifest to use it and
you can easily access it from any context. Say you have MyApplication
extending Application, then
hi james, thanx for reply. I try to explain what I want to achieve.
It is actually very simple, but maybe I am walking on the wrong path
since I think in the Windows way other than in the Android way :)
My app is a window with 3 buttons (can't use tab since the buttons
will increase in the
If you are more specific about what the 3+ buttons are supposed to do,
we may be able to suggest alternatives.
To answer your question, setContentView is needed with ActivityGroup.
Yusuf Saib
Android
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of
thank for your reply, but I still have some troubles:
now I have my main activiy been a ActivityGroup and the child activity
been a simple Activity.
I start the child with this code:
Intent startIntent = new Intent(MyMainActivity.this,
ChildActivity.class);
Hi,
I'm still not sure what you're trying to achieve. Are you really trying to
embed an activity within another? You can look at the TabActivity source for
a pretty clean example:
Hi,
Those are meant for an ActivityGroup and its embedded activities, for
example a TabActivity.
What you might want to look into, is this introduction on opening screens
(activities):
http://developer.android.com/guide/appendix/faq/commontasks.html#opennewscreen
Cheers,
James
On Tue, Oct 13,
8 matches
Mail list logo