back

Android Webview with Back Button, if else

£可爱£侵袭症+ 提交于 2019-12-03 03:16:45
Disregard. I was opening the wrong app that was installed. It works wonderfully. :) I have the back button working correctly within my webview, but I was wondering something. How to make the webview go back until it cannot anymore, and instead of exiting the program, have it open up a dialog box asking if the user is sure they won't to exit. Here is my take on the code. Thanks for taking the time. .java file package com.vtd.whatthe; import android.app.Activity; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.Dialog; import android.content

Possible bug with <select><option> value modification and Back button on Chrome

廉价感情. 提交于 2019-12-03 02:15:12
Chrome Version (type about:Version 28.0.1491.0 canary and 26.0.1410.65 Google Chrome): Operating System (Mac OS X Mountain Lion): The problem only occurs with Chrome Canary and regular Google Chrome. There is no issue with Firefox, Safari nor IE9 (Windows tested) latest versions. The code below changes all the stateBill values to be the same as the text values. Then submit it to another page and click Back button of browser page. The selected option is NOT visible (ie it shows blank) on the drop down, even though the html source still shows it selected. If I don't execute the jquery function

Javascript / jQuery back button - so long as last page was part of current site?

非 Y 不嫁゛ 提交于 2019-12-03 01:41:06
With the code below I can make a 'back' button, but is there a way of making the link require that the last page was part of the current site? $(document).ready(function(){ $('a.back').click(function(){ parent.history.back(); return false; }); }); If the last page wasn't part of the current site then ideally id like to be able to specify a backup link. Thanks How about using document.referrer ? $(document).ready(function(){ $('a.back').click(function(){ if(document.referrer.indexOf(window.location.hostname) != -1){ parent.history.back(); return false; } }); }); Galen Please don't do this. But

Safari <body onload> event doesn't trigger from the back button

喜你入骨 提交于 2019-12-02 22:10:12
问题 I don't seem to be able to get the body onload="..." event to fire in Safari when the page is entered via the back button. It works fine in FF and IE. Is there a Javascript or jQuery solution? Any help appreciated. 回答1: Try: window.addEventListener("pageshow", function() { alert('page shown'); }, false); For Opera browser, read this: http://samuli.hakoniemi.net/onload-issues-with-opera/ 回答2: This is well known. Safari and many other browser cache the page and when you navigate back to it,

back button in browser not working properly after using pushState (in Chrome)

非 Y 不嫁゛ 提交于 2019-12-02 22:04:42
I am using this type of line in an JS response if (history && history.pushState){ history.pushState(null, null, '<%=j home_path %>'); } but when I click back in the browser, I see the JS code of the response instead of the previous page. Is there a way to make the back button work so it would re-request the page of the last url (before home_path as pushStated in? Update : I've found this .. it seems other have the same issue with.. History.js doesn't fix it either So to confirm some of the comments there.. This happens only in chrome What I think I think the root of all this is that the

Implementing back button in webview fragment

旧时模样 提交于 2019-12-02 21:46:14
问题 I want to implement the back button to my app. I'm using fragments that each show a different webview. Right now if I press the back button, it closes the app no matter where I am. I would like for it to go back, just like a browser. I have my MainActivity.java , fragment1.java , etc up to fragment5.java Here is my MainActivity.java : package com.----; import java.util.Locale; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity;

Curing the “Back Button Blues”

走远了吗. 提交于 2019-12-02 20:59:53
Ever stumbled on a tutorial that you feel is of great value but not quite explained properly? That's my dilemma. I know THIS TUTORIAL has some value but I just can't get it. Where do you call each function? Which function should be called first and which next, and which third? Will all functions be called in all files in an application? Does anyone know of a better way cure the "Back Button Blues"? I'm wondering if this will stir some good conversation that includes the author of the article. The part I'm particularly interested in is controlling the back button in order to prevent form

Android Back Button Doesn't Return to Previous Activity

柔情痞子 提交于 2019-12-02 19:38:06
I have an app that has two activities: MainActivity and SettingsActivity. The MainActivity has a menu with a single Settings menu item. When this menu item is clicked, it launches the SettingsActivity with an intent. After the activity starts up, I click the back button in the top left corner and nothing happens. I assumed since I started the activity using an intent, the activity stack would be managed automatically. I want to return to the MainActivity. Am I wrong in this assumption? MainActivity.onMenuItemSelected public boolean onMenuItemSelected(int featureId, MenuItem item) { int itemID

Android Back Button and Progress Dialog

那年仲夏 提交于 2019-12-02 16:37:18
I have an AsyncTask that shows a progressDialog whilst working (it calls runOnUiThread from within doInBackground to show the progress dialog). Whilst its running I want to allow the use of the back button to cancel the operation; someone else has had this problem: BACK Button is not working ,while progressDialog is running For what ever reason I can't reply to that thread, hence having to start another?! (Another question for another day) I had the same idea as Sandy but this code is never called whilst the progressDialog is showing, why is this? I have implemented it inside my main activity

Handling back press when using fragments in Android

廉价感情. 提交于 2019-12-02 15:19:16
I am using Android Sliding Menu using Navigation Drawer in my application and Fragments are used in the app instead of Activities. When I open the drawer, click on an item a Fragment appears. I move from one fragment to another fragment using the following code: Fragment fragment = null; fragment = new GalleryFragment(selectetdMainMenu.getCategoryID()); FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.addToBackStack("menuFrag"); ft.add(R.id.frame_container, fragment, "menuFrag"); ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); ft.commit(); In this way I can go