Android: Cancel Async Task

I use an async task to upload an image and get some results. While uploading the image I see a progress dialog, written in onPreExecute() method like this: protected void onPreExecute() { uploadingDialog = new ProgressDialog(MyActivity.this); uploadingDialog.setMessage(“uploading”); uploadingDialog.setCancelable(true);; } Ok when I press the back button, obviously the dialog disappears because of the setCancelable(true). … Read more

How to handle Back button with in the dialog?

I am developing an application that when the button is pressed, it opens a dialog with OK and Cancel buttons. It works fine. When the user presses the back button, I am handling this as follows public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK)) { } return super.onKeyDown(keyCode, event); } But the … Read more

Back to previous page with header( “Location: ” ); in PHP

The title of this question kind of explains my question. How do I redirect the PHP page visitor back to their previous page with the header( “Location: URL of previous page” ); Answer try: header(‘Location: ‘ . $_SERVER[‘HTTP_REFERER’]); Note that this may not work with secure pages (HTTPS) and it’s a pretty bad idea overall … Read more