FAQ Database Discussion Community

Android MediaPlayer stops on backpressed

I'm developing a radio stream app.I use android - mediaplayer class which plays radiostream. I m trying to run app in two devices . When I pressed back button in Samsung galaxy S3 mini(4.2.2) radio stream continues to playing. And I controls media player with notification bar. But when I...

Software back button android

I need a back button with same functionality as default back button of device but inside of app.

Back Navigation in Android Without ActionBar

I have 3 screens, Screen 1 , Screen 2, Screen 3. This is the kind of back navigation that I am implementing, Screen 3 -> Screen 2 -> Screen 1. Here is my below code for screen 1 public class Screen1 extends Activity implements OnClickListener{ Button button1; @Override protected void...

Back Key not working properly

I want to add the back key in my application so I added this onCreate(){ getActionBar().setDisplayHomeAsUpEnabled(true); } And this if(id == android.R.id.home){ this.finish(); Intent intent = new Intent(getApplicationContext(),MainActivity.class); startActivity(intent); } It works fine when i press the back button from the App But when I press physical back button key...

Control the finish of activities in android

There are two activities in my app Activity A: Select Country Activity B: Select Region First I enter Activity A, select a country, then will jump to Activity B, and I would like to keep the case like this: requirement 1 : if in Activity B press back, then go...

How can I go back one step when processing a list of (user) choices?

I have a series of user choices (implemented as input boxes). Short Example: Answer = InputBox("Choose: 1 - One 2 - Two", "Choose")) If Answer = "1" Then Answer = InputBox("Choose: 1 - Hi 2 - Hello", "Choose")) If Answer = "1" Then.... I want to know if VBScript can...

How do I enable my back button only when a link is clicked in my UIWebView? (Code won't execute)

I'm trying to make it so that the back button will only be enabled when the user presses a link and/or if canGoBack = TRUE. I tried using an if statement in the body but that didn't work. I then tried using what I could find online and it still...

UINavigationController hides back button only on second appearance of view

I have three view controllers: A login view, a home tableview screen, and a detail tableview screen. These are all part of the same UINavigationController. On the home screen, I want to disable the back button, preventing a user from backing into the login screen. So in the viewDidLoad() function...

How to delete a viewcontroller from a split view controller (ipad back button )?

I have used the following code for deleting my login page from the navigationcontroller(viewcontrollers) so that it will not come into the view again when going back(back button). if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { NSMutableArray *VCs = [NSMutableArray arrayWithArray: self.navigationController.viewControllers]; if ([[VCs objectAtIndex:[VCs count] - 2] isKindOfClass:[loginViewController class]]&&(VCs.count>=4)) { [VCs removeObjectAtIndex:[VCs count]...

Login Form keeps coming back

This is my login page : " This is the form , form action="" is set to none (may be the problem?) < form action="" method="POST"> Username: < input type="text" name="user"> Password: < input type="password" name="pass"> < input type="submit" value="Login" name="submit" /> < /form>" $query=mysql_query("SELECT * FROM login WHERE username='".$user."'...

Xcode Master Detail Application back button properties

How do I add properties for the "back button" in the navigation bar? The button links from detail view and back to the master view. I can't find any code for the back button, and the button is hidden in storyboard view.

Go back to unvisited page on IOS

I am unfamiliar with IOS development, so probably a simple question: is it possible that the user presses the "back" button on the top, and go to a (so far) non-visited page? Here is the picture: On window "1" user presses a button, the next window is "2". But here,...

Prevent Downloads from browser back and forward buttons

I am using rails4 and in my controller page I have xl download like below. Everything works fine but when I use the browser's back and forward buttons, it is downloading the same content again and again. How can ? get rid of it? def download_report @acquisitions = AcquisitionReport.generate(params[:acquisition_id].to_i, params[:portfolio_id])...

How to make Google Chrome and iOS remember scroll position in div after returning back?

The problem is that the scroll container is a div, not body. And that causes Google Chrome and iOS to fail to remember scroll position of the div after users go to another page and then return back. The related CSS code is as follows. The scroll container is #container....

Button finish activity after 2 press is WRONG: Android

I want the button to finish the activity. Why do I have to press it TWICE for it to finish, I do not want this. Note, I have to press the button twice before the activity ends, which I do not want. MainActivity Class: private Runnable updateOkay= new Runnable() {...

Javascript history error: Going back seems broken

I'm currently messing with the browser history with javascript, and I almost have what I want. But I encounter one huge error, let me explain the situation: I have a menu, and when pressing on a menu item, the following code is executed: $("#content").load("http://example.com/menuitem"); window.history.pushState({ page:"http://example.com/menuitem" },"", "http://example.com/menuitem"); document.title =...

How to close an android application by pressing back key twice?

I saw many android applications that if you press the back key once a toast will pop out warning the user that if you press the back key one more time it will close the android application. How can I do that? EDIT: This is different from just closing the...

how to handle hardware back button from a service in android

I'm writing a client program where I'm running a service in server for communication. android hardware back button can be controlled through OnKeyDown method or OnBackPressed Method from an activity. But how its done from a service ?

Title back button onCreate

My app starts with the MainActivity, which is nothing but a simple menu with buttons for sub menus: Start Options Help etc... Each sub menu option starts a new activity. These new activities (submenus) will have a Back button on the top in the Title bar. When I press these...

Back Button in ActionBar at MainActivity

I have implemented a Back-Button for all Activities except the MainActivity. My Problem is that i have a Back-Button in that MainActivity too. Hopefully I've imported the right class: import android.support.v4.app.NavUtils; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getActionBar().setDisplayHomeAsUpEnabled(true); [...] } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action...

How to control the back button navigation in ipad (UISplitViewController)ios xcode

I have used the following code for deleting my login page from the navigationcontroller(viewcontrollers) so that it will not come into the view again when going back(back button). if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { NSMutableArray *VCs = [NSMutableArray arrayWithArray:self.navigationController.viewControllers]; if([[VCs objectAtIndex:[VCs count] - 2] isKindOfClass:[loginViewController class]]&&(VCs.count>=4)) { [VCs removeObjectAtIndex:[VCs count] - 2];...

Stop angular $timeout timer after hitting back button

In my Angular app, I have Page 1, and Page 2. Page 1 is basically the home page with a button linking to Page 2. Page 1 has an angular app called Page1App and a controller called Page1Ctrl. Page 2 has an angular app called Page2App and a controller called...

how to copy back button action to another button

I have a button in which I want to have the same feature of the usual BACK button. But just calling the finish() is not doing the required. I tried calling onBackPressed() but it needs to create a separate method. Any solution? t1.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0)...

How to set back key action on Android

I'm working on an Android application that starts from an activity that serves as the menu screen (I'll call this activity the menu activity). There is a button that moves the app to another activity where the user can enter their name (I'll call this activity the name activity), and...