Back button not finishing subactivity

Put your problem here if it does not fit any of the other categories.

Back button not finishing subactivity

Postby bluefloyd8 » Thu Apr 03, 2008 5:27 am

Hey all! I have an activity which calls a subactivity like so:

i = new Intent(this, mapdisplay.class);
startSubActivity(i,1);

When i am inside the mapdisplay activity, hitting the back button does nothing. It should bring me back to the calling activity right?

I overload the following in mapdisplay.java:
@Override
protected void onActivityResult(int requestCode, int resultCode, String data, Bundle extras) {


any ideas?
User avatar
bluefloyd8
Experienced Developer
Experienced Developer
 
Posts: 70
Joined: Tue Jan 22, 2008 3:57 am
Location: Indiana, USA

Top

Postby bluefloyd8 » Mon Apr 07, 2008 5:51 pm

Bump.

Anyone have any ideas?
User avatar
bluefloyd8
Experienced Developer
Experienced Developer
 
Posts: 70
Joined: Tue Jan 22, 2008 3:57 am
Location: Indiana, USA

Postby zeeshan » Tue Apr 08, 2008 7:12 am

use this ....

private void finishActivity() {
this.setResult(InitializeConfiguration.SUBACTIVITY_RESULTCODE_CHAINCLOSE);
finish();
}


protected void onActivityResult(int requestCode, int resultCode,
String data, Bundle extras) {
switch(resultCode){
case InitializeConfiguration.SUBACTIVITY_RESULTCODE_CHAINCLOSE:
this.setResult(InitializeConfiguration.SUBACTIVITY_RESULTCODE_CHAINCLOSE);
this.finish();
break;
}
/* Finally call the super()-method. */
super.onActivityResult(requestCode, resultCode, data, extras);
}
zeeshan
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Mon Mar 03, 2008 6:10 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 18 guests