Back Stack in Windows Phone 8.1 - windows-phone

I am developing a Windows Phone 8.1 app. In that I need to to navigate from
Page1 --> Page2--> Page3
But I don't want Page1 to apper again when I keep on pressing back button.
Page3-->Page2-->Exit the app
I was able to achieve this using Frame.BackStack.Clear() in the OnNavigatedFrom() of Page1. But the problem is when I click the app icon again its only launching from Page2 not from Page1.
So I want to understand, why the back stack is not cleared when we press
back button and exit the app. And how to achieve the behavior I require

Windows Phone 8.1 Store apps do not close when you are navigating back from the first page. Instead they only get suspended. So once you start open it again, you end up on the last running instance of the app again, this includes backstack, page state, etc.
In the app.xaml.Cs's OnLaunched handler, you can intercept this behavior: You can check the e.PreviousExecutionState where you can check, if you want to handle it as a real restart.
In that case you just dump the current Frame and replace it with a new one, or clear the backstack and start with a new navigation.
Also: The Backstack is a list. You can remove single entries any time and not only completely clear it with the RemoveAt method.

Your methods sounds okay to me. It is that the app runs behind the scene. Unless you write a code like this it will keep running in the last position you kept.
Application.Current.Exit();

Related

How to restart application after sometime when we minimize it from home button and open it again

I have created Mobile application in React native.
My problem is that whenever i open my app from launcher icon and minimize for sometime (eg: 10 minutes) then if i re-open my application from recent apps or else on clicking launcher icon again it should restart the application as it opening for the first time.
But doesn't matter how much time i minimize the application when i open it again it will open as a previous state.
How to solve this issue.
What Navigation module are you using? Depending on it, you need to call a method to init the app and that method must be called again when you switch back to the app.
Normally, application has their inherent state as snapshot when it go to background if the user do not close directly.
If you are testing on android, pressing backbutton on top of the navigation makes close the application. (you can control this if you want.)
In iOS, pressing home button always send the application into background instead of close.
I am not sure what OS you are using for development. But refer it.

Windows Phone App back button blank screen

I am developing a Windows app where I have login screen and from there I am navigating to different pages depending upon user's access rights. This bit is working fine. But when user click back button on phone it shows blank screen. I think reason for this is because I am not on MainPage.xaml it is on another page and by clicking back button it come back to mainpage where it has nothing to show. I may be wrong.
Has any one faced this problem Please help me because I am ready to put my app on live this is the only problem I am facing.
If your mainPage is log in page and you are navigating from main page, after successful log in remove main page entry from back stack. So that it will exit the app instead of showing blank page.
For removing entry from Page stack you can use following.
this.NavigationService.RemoveBackEntry();
Please check around before you post question.

Back button overriding in windows phone for webbrowser/view

I am implementing a simple webview application with only one url. I have over ridden back button function for webview navigation (which is working fine). Now my app has only one screen with webview and user visits the links inside main url and navigates using back button.
I want to know that, What is Microsoft Certification Policy as my application has only one screen so should it Close when user press back button anytime? Or Microsoft allows implementing of webview with over ridden back button functionality.
If question is still unclear Kindly tell me. I'll explain more but I need to know answer to this question.
Thanks.
You shoulld be fine, I have submitted applications which works like that myself which passed certification.
As long as the application quits when pressing the back button when there is no more "history" for the webbrowser control it shouldn't be a problem because the user still get the experience of moving "backward" in his use and can finally quit the app.
Regarding WebBrowser control and content of the app please consider this requirement:
"Your app and metadata must have distinct, substantial and legitimate content and purpose. Your app must provide functionality other than launching a webpage."
So, the application's sole functionality must not be only to launch a website.
This is not releated to back button but very important thing that need to be considered!
Best regard

How do I programmatically navigate to the start screen from within a Windows 8 javascript app?

I am developing an app that allows the user to make certain changes to tiles on the Windows 8 start screen. When a change has been made within the app, the user will be shown a "View my changes" button. Clicking the button should bring the user back to the start screen.
I have looked into different ways of closing/suspending the app programmatically (and thus taking the user to the start screen), but I have not found a way to achieve this using WinJS. Throwing an exception closes the app, but this seems like a very dirty workaround. Any suggestions?
I'm assuming you are creating secondary tiles and want to show the users what they look like? #mydogisbox is right in that this kind of functionality has probably been deliberatly excluded.
I'd recommend to just do an in-app 'view changes' of whatever changes to secondary tiles the user might have made. In general, I'd argue that this would be a better user experience because you will keep the user engaged within your application and not be essentially kicking them out of the experience.

How to terminate process in vb.net (windows phone 7)

Hi my app currently has a process thats ongoing (even when I navigate back to the main screen of my app). Is there any code I can use to terminate all the processes on that page before it navigates back to the main screen. In other words the page should reset to its original form
are you asking if you can stop a certain thread(not a process) ?if so please read the following post Stopping Threads