hihi!
behavior of design is no problem,
but just only that, you seted incorrect Intent_Flag.
you should set Intent_Flag as below:
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_CLEAR_TOP);
if you set it, you want behavior that is correct.
V.Nhan!!
On 1月10日, 午前12:15, Dan Raaka <[email protected]> wrote:
> This is something to do with the launching activties when there are
> multiple available in a apk.
>
> Take an example is Settings
>
> com.android.settings.WirelessSettings
> and
> com.android.settings.SoundAndDisplaySettings
>
> From an example application A, when I launch WirelessSettings, it pops
> the screen showing wireless settings. Now when I switch to A using the
> task switcher (long keypress of HOME), and try to launch
> SoundAndDisplaySettings, I see the screen for wireless settings. !!
>
> This after using flags like
>
> .........
> ComponentName toLaunch;
> ..............
> if(selectedIcon == ICON_WIRELESS)
> toLaunch = new ComponentName("com.android.settings",
>
> "com.android.settings.WirelessSettings");
> else
> toLaunch = new ComponentName("com.android.settings",
>
> "com.android.settings.SoundAndDisplaySettings");
> .................
>
> void launchApp() {
> if (toLaunch != null) {
> Intent intent = new Intent(Intent.ACTION_MAIN);
> intent.addCategory(Intent.CATEGORY_LAUNCHER);
> intent.setComponent(toLaunch);
> intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
> |
> Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
> mActivity.getInstance().startActivity(intent);
> }
> }
>
> I was expecting it a behave otherwise.
>
> This works fine "if" I were to hit "BACK" key from the settings, go
> back to A, and launch the Settings again.
>
> Is this behavior by design ?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---