back

Android back button problem

谁说胖子不能爱 提交于 2019-12-06 16:15:25
问题 Say I have 3 Activities in my application: A, B and C. The flow though the application is: A -> B -> C. Once at C, pressing the back button will take the user to B. If the user presses the back button another time they got to A, and finally if they press it one more time, they exit the application. Objective: When the user presses the back button on C, they should go to A and not B, and if they press it another time, they exit the app. Problem: When overriding the back button on Activity C to

problem in activity finish() and on pressing back button in android

安稳与你 提交于 2019-12-06 13:29:19
问题 I am very confused in using finish() for activity and using back button of keypad.I have created many activities so on moving from one activity to another I finish the last activity. And also I have used back button in my activity so I can go back (from where I came) by pressing back button but problem arises when I use keypad's back button I go to any other activity .I want it should work as my activity's back button. And I think this can be done by using onKeyListener and chekcing keypad's

iOS 7 UINavigationBar has hidden back button

隐身守侯 提交于 2019-12-06 08:10:48
问题 I have an app which has a back button with a custom image in its UINavigationBars. In iOS 6 everything is fine but in iOS 7 the button is 'invisible' most of the time. When I push a new view controller into the UINavigationController the back button does not appear for the new screen, though if I touch where the button is supposed to be it fades in. If I set two view controllers on the navigation controller without animation then the button shows up fine but doesn't appear for subsequent

Adding an action to back swipes swift 4

瘦欲@ 提交于 2019-12-06 07:57:20
I have changed the back button in my navigation bar in one of my view controllers to a custom button and gave that button an action to do when pressed by: self.navigationItem.hidesBackButton = true let backButton = UIBarButtonItem(image: UIImage(named: "backArrow"), style: .plain, target: self, action: #selector(self.back)) self.navigationItem.leftBarButtonItem = backButton This worked perfectly and I was able to keep the back swipe to pop the view controller by using: self.interactivePopGestureRecognizer?.isEnabled = true self.interactivePopGestureRecognizer?.delegate = self in my navigation

Android ActionBarSherlock On Top Icon Back

允我心安 提交于 2019-12-06 06:04:48
问题 I'm trying to make my top action bar icon to allow users to go back to previous screen. I tried to implement these codes. But none are working. Can anyone please guide me on this. I know this looks simple, I'm new to android . Below are my codes. Problem : When i tap on the icon button it just cleared my screen without going to the previous screen. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.view_item); checkInternetConnection(

finish activity in onActivityResult does not work

大兔子大兔子 提交于 2019-12-06 05:13:36
问题 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

android toolbar: how to go back to previous activity if back arrow is pressed

家住魔仙堡 提交于 2019-12-06 04:29:19
问题 I have an activity called Place I come to Place activity from its previous activity called City . I have added back button to the toolbar in Place activity using the following code: Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true) I want to set the back button to go back to City activity But City activity needs some parameters to be passed to it. So how to tell the back button to go to City activity,

Javascript/jQuery detect hash change only on browser back/forward button click

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 02:57:53
问题 Is it possible to detect the hashchange only on a browser history change (i.e. Back or Forward button)? I have seen the onBeforeUnload event, but this event does not fire on hash change, as the window is not unloading. The hashchange event obviously fires anytime the hash changes. Any fix? Preferably without a plugin. I have seen the jQuery history plugin, but am looking for the simplest solution. Thanks for the help. 回答1: Take a look at the window.onhashchange event. It is not currently

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

梦想的初衷 提交于 2019-12-05 20:56:29
问题 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()

UIWebView won't goBack after loading HTML in iOS

99封情书 提交于 2019-12-05 09:42:51
I'm having this problem in my iPhone app: I have a webView which is first loaded with an HTML string. After the user clicks a link and it loads the requested page, the webView won't go back when I call the method [UIWebView goBack]; I suppose webView doesn't cache the HTML string. Is there any way I can make webView cache my HTML string without having to save it in a NSString myself? You can use the canGoBack property and if you can't go back, reload the UIWebView with the original html. If the user has navigated forward using links then the canGoBack property will return YES and a goBack can