Friday, September 3, 2010

[android-developers] Launch two Activities extended from another one.

Hello, folks! I face some problems with activities and it seems that I
am stuck here. So, that's the issue: I have two activities extend
another one

BaseClass.java
public class BaseClass extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(state);
// We can make out here which activity (A | B) to create.
}

protected void onRestart() {
super.onRestart();
}
}

A.java
public class A extends BaseClass {
@Override
protected void onCreate(Bundle state) {
super.onCreate(state);
}
}


B.java
public class B extends BaseClass {
@Override
protected void onCreate(Bundle state) {
super.onCreate(state);
}
}

In AndroidManifest.xml I show that A and B can be user-launched.

Well, now I can not realize how to launch B activity while A is not
destroyed. That is I start A, then press Home key and move task back,
then try to start B, but get onRestart() of my BaseClass, not
onCreate(). I can finish() BaseClass activity on every onStop(), but I
want to have both activities launched. Guess, the decision is
something simple, but I am new in Android so far.

Thanks for help in advance and sorry for my bad language :)

--
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

No comments:

Post a Comment