0

I'm using GreenDroid ActionBar's component and I've two strange behaviours when I'm using the ActionBar's Home button.

I've a 3 activities:

  • myMainActivity that extends GDListActivity.

  • myDetailedItem that extends GDActivity, that it's showed when the user presses a list item.

  • myInformation that also extends GDActivity.

The first rare thing is after click the Home button I cannot get an intent value I pass to the myDetailedItem.

The process is: myMainActivity --> myDetailedItem --> myMainActivity (use the Home button) --> myDetailedItem, but in this activity I don't recieve the intent value when using getIntent().getIntExtra("myValue",-1) that I've put in myMainActivity and it perfectly work the first time and it always works when using the back button.

The second strange thing is doing the following: myMainActivity --> myDetailedItem --> myMainActivity (Home button) --> myInformation (button in ActionBar) --> myDetailedItem (when pressing back button) instead of going to myMainActivity

In myApplication I've:

@Override
public Class<?> getHomeActivityClass() {
    return myMainActivity.class;
}

And also tested with these two overrides:

@Override
public Intent getMainApplicationIntent() {
    return null; 
}

and:

@Override
public Intent getMainApplicationIntent() {
    return new Intent(Intent.ACTION_DEFAULT); 
}

How can I solve these problems? Are they related each other?

Thank you in advance,

tweekat
  • 1
  • 1

1 Answers1

0

At the end I have been able to find my mistake. I don't know why, probably copying from somewhere, I had in my AndroidManifest the following property in the myMainActivity:

android:launchMode="singleInstance"

I have changed it for singleTask and now the behaviour of the Home button is correct and the intent problem is also solved.

Bitmap
  • 12,402
  • 16
  • 64
  • 91
tweekat
  • 1
  • 1