3
votes

I have experienced such a weird behaviour from titanium project using alloy that runs on android. I created a new window and then link it to another. like in android when you click button on activity 1 it refer to activity 2. when i click back button it back to activity1 (in android). But in alloy, when i pressed back, no matter on windows i'm in, it always back to home. Not back to the first window (or before it). How can i do such a thing in alloy to get the back button result same like in android.

activity1>>activity2>>activity3>>activity4

when you pressed back button it should back to activity3, but in alloy its just back to home.

If someone know how to achieve that (same like in android). Or simple example would be better.

NOTE: it solved using classic mode. i'm confused using the mvc one.

1
You need to show what exactly you are doing. Chances are you aren't setting your windows up as heavyweight in your Alloy code.Tony Lukasavage

1 Answers

0
votes

Write this piece of code when the window loads:

win.addEventListener('android:back', function(e) {
    console.log("Pressing Back Will Not Close The Activity/Window");
    win.close();
});