back

How can I detect a user about the exit the page? [closed]

∥☆過路亽.° 提交于 2019-11-29 07:24:39
问题 I would like to detect when a user is about to exit the page, before they click the back button , and do something - for example display a popup. I do not want to prevent the user from leaving the page, but only to grab their attention again. This is already done by Optin Monster, but I want to implement it myself. Where to start? Edit: beforeunload is fired after the user clicked the back or x button. I would like to catch his exit intent , for example when the mouse is moving towards the

Remove Template cache on logout Angular.js

依然范特西╮ 提交于 2019-11-29 06:38:45
How to remove Angular template cache once user clicks on logout? We did thorough research and tried to implement most of the solutions available out there. we tried following HTML Meta Tags <meta http-equiv="Cache-Control" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> Server side res.setHeader('cache-control', 'no-cache', 'no-store', 'must-revalidate'); Javascript We tried to delete browser history as specified on this blog Problem we are facing right now is when a user logs out from our app and press back button he is shown

Startup JavaScript code is not executed when using the Firefox “Back” button

爱⌒轻易说出口 提交于 2019-11-29 04:54:33
This website has a fancy effect: when a navigation link is clicked, the content fades out and when the new page (on a different URL) loads, its contents fade in. What's interesting is, after users click on the "Back" button of their browsers, they go back to the previous page and the content still fades in . In other words, the previous page doesn't stay at the faded-out state, which is what was last seen. According to this comment , a page should be staying at its last seen state. I tried many ways to reproduce this effect, yet on my tests, after clicking on the "Back" button the previous

AngularJS redirect a route only on browser's back button

我是研究僧i 提交于 2019-11-29 02:46:48
In my AngularJS application I'm redirecting the route to a specific page when the user isn't logged. To do that I'm using a variable on $rootScope . Now I would like to prevent the browser's back button when the user is logged. I would like to redirect it to a specific page (the registration view). The problem is I don't know if there's a back button event . My code is: angular.module('myApp',[...] //Route configurations }]) .run(function($rootScope, $location){ $rootScope.$on('$routeChangeStart', function(event, next, current){ if(!$rootScope.loggedUser) { $location.path('/register'); } });

Can't pass back event from Unity to android library jar

时光总嘲笑我的痴心妄想 提交于 2019-11-29 02:29:28
I am quite new at Unity and I am trying to create a Unity plugin for an Android library jar and I am facing the following issues: I can't find a way to pass the back button event to Android library. It seems that Unity prevents this event to be passed to the library layer. What I have managed to do is to pass touch events to the activity on the Android side by setting the following line <meta-data android:name="unityplayer.ForwardNativeEventsToDal vik" android:value="true" /> at <activity android:name="com.unity3d.player.UnityPlayerProxyActivity" ... > in the AndroidManifest However I cannot

React Native - Device back button handling

谁说我不能喝 提交于 2019-11-29 01:15:41
I want to check if there are more than one screens are on stack when device back button is hit. If yes, I want to show previous screen and if no, I want to exit app. I have checked number of examples but those use BackAndroid and Navigator. But both of them are deprecated. BackHandler is replacement for BackAndroid. And I can show previous screen by using props.navigation.goBack(null). But I am unable to find code for finding screen count in stack. I don't want to use deprecated Navigator! Virat18 This example will show you back navigation which is expected generally in most of the flows. You

Android make view disappear by clicking outside of it

孤街浪徒 提交于 2019-11-28 19:48:02
问题 I have some views that I make visible upon a button press. I want them to disappear if I click outside of those views. How would this be done on Android? Also, I realize that the "back button" can also assist Android users with this - I might use that as a secondary way to close the views - but some of the tablets aren't even using a 'physical' back button anymore, it has been very de-emphasized. 回答1: An easy/stupid way: Create a dummy empty view (let's say ImageView with no source), make it

Remove page from history, so “back” will work properly

拜拜、爱过 提交于 2019-11-28 19:22:32
I have my app that you need to login to get in to the other pages. so the first page is "login" and it checks if you are already logged, if so you will be redirected to the main page app, if not it will show you the login page. now the problem is when the user is inside the logged page area, and he clicks back he will get to the "login" page and than redirected back to the main page, as he is logged in already. So he is stuck in an infinite loop. how can I remove the login page from the history. just like in android "android remove activity from history stack" Tzook Bar Noy here is the

How to read data from shape/graphics object

删除回忆录丶 提交于 2019-11-28 14:25:15
I am wondering if it is possible to get the data that is stored in a shape/graphics object in flash using actionscript 3? In my project I would like to be able to draw a shape and then read all the points in that shape into my script. The reason for that is that I need go generate lines from those points that I later can use to check if my characters velocity intersects with any of them. You can read all parts of Shape. New feature added to Flash Player 11.6 and AIR 3.6: flash.display.Grapics.readGraphicsData() http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display

When I exit an application the sound runs on the background

人走茶凉 提交于 2019-11-28 12:56:13
I "created" an application and when I go back or I press the home button to exit from the application, the audio from my application is still running! I have to close all running apps to make it stop. How can I stop the audio running when I press the home button? Override the onPause() method of all your activities, and turn off/pause/stop the music when it's called. You might want use a boolean flag to check if you're moving within your app, a scenario in which you'd want the music to continue: boolean movingInApp = false; .... movingInApp = true; Intent intent... ..... public void onPause()