Hi,
I am new to Android, so I still am having some basic dificulties.
I have 2 classes that extend "Activity", MyActivityA.java and
MyActivityB.java.
How do I start MyActivityB from MyActivityA and access its public
variables?
Comming from C++ I would expect something like:
...
{
MyActivityB actB=new MyActivityB();
actB.varX="Hello";
actB.startActivity(new Intent(this, MyActivityB.class));
}
But this doesn't work. It throws an exception. By searching online I
allways see starting an activity like this:
...
{
startActivity(new Intent(this, MyActivityB.class));
//But now how do I get an instance to MyActivityB class that was started?
}
I would really prefer to access the MyActivityB class public variables.
I know of passing parameters in the Intent using putExtra(), but I am
looking for an alternative because of the complexity of the project.
Thanks
--
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