back

finish activity in onActivityResult does not work

倾然丶 夕夏残阳落幕 提交于 2019-12-04 09:05:39
I have a pair of activities that must live or die together. Basically AlphaActivity does some work and then dispatches an intent ( startActivityForResult() ) for BetaActivity. When BetaActivity is done, I want it to dispatch an intent ( startActivity() ) for GammaActivity and then call finish() on itself. Upon finishing I was hoping for AlphaActivity's onActivityResult() method to be called, but that never seems to happen. My design is such that inside AlphaActivity's onActivityResult() , I call finish() . My plan is such that once GammaActivity is reached, a user cannot ever return to either

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

前提是你 提交于 2019-12-04 08:56:21
问题 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 回答1: How about using document.referrer ? $(document).ready(function(){ $('a.back').click(function(){ if(document.referrer.indexOf

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

只谈情不闲聊 提交于 2019-12-04 08:28:35
问题 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

Android Back Button Doesn't Return to Previous Activity

痴心易碎 提交于 2019-12-04 07:59:54
问题 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?

Handling back press when using fragments in Android

99封情书 提交于 2019-12-04 07:40:50
问题 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,

CakePHP no layout on back and forward button

江枫思渺然 提交于 2019-12-04 06:21:10
问题 We're building a large CMS in CakePHP with a Croogo install incorporated. We've run into an issue recently where the layout is not rendered correctly when users click the back in the browser (or the forward button for that matter). What you end up with is the view (.ctp) file using the blank layout, so no styles, js, etc. Any input or ideas would be much appreciated. Thank you! FYI: modern browsers should cache the page request (cache is enabled), so we're looking at the Auth stuff coz it

Difference between actionBar back button and android back button

浪尽此生 提交于 2019-12-04 05:06:19
What is the difference between actionBar back button and android back button? Because it's seems that the ActionBar back button which is called with: ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); it works way better... example: when I press the ActionBar back button the animations are there, but if I press the default back button they aren't. I can change theme from a preference activity: If I go back with the ActionBar back button the colors instantly changed, but with the default I have to restart the app.... how can I make my default back button to

Javascript move multiple elements to separate div's and back

旧巷老猫 提交于 2019-12-04 04:54:58
问题 There are 3 videos, placed in 3 separate div's. There also are 3 separate div's, but in other position of a page (lets say contA and contB and contC). I want that if I click on the video1, then video2 and video3 goes to contA and contB, and video1 goes to contC. If I click video1 again, all videos go back to their original position. If I click on video2 (while its in contA), then video1 goes to contA, video3 goes to contB, video2 goes to contC. I have prepared a jsbin demo: Jsbin DEMO Anyone

How can I dismiss the Navigation Drawer to use the Back-home-icon button?

丶灬走出姿态 提交于 2019-12-04 04:39:40
I'm using the action bar with search bar too, and I need to use the ActionBar ico like a Back button: But I'm using the navigation drawer too... How can I dismiss/hide/disable the Navigation Drawer menu to use the back button? My ActionBar code: @Override public boolean onCreateOptionsMenu(Menu menu){ MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.main, menu); this.getSupportActionBar().setDisplayShowCustomEnabled(true); this.getSupportActionBar().setDisplayShowTitleEnabled(false); this.getSupportActionBar().setDisplayHomeAsUpEnabled(true); this.getSupportActionBar()

What is the equivalent to “OnBackKeyPress”

淺唱寂寞╮ 提交于 2019-12-04 04:34:22
In Windows Phone 8.0 I used this to handle the back button: protected override void OnBackKeyPress(CancelEventArgs e) { base.OnBackKeyPress(e); } This Event does not exists on the "Page" control. How can I handle a click on the back button in WP 8.1? Romasz Take a look at Windows.Phone.UI.Input.HardwareButtons . If you add a Basic Page to your project then VS will add a NavigationHelper class to your project which helps with Navigating thru your App, you can also see in the source code that it is subscribing to Windows.Phone.UI.Input.HardwareButtons.BackPressed . In case you want to extend