Android :: Stop Or Refresh An App Activity
Aug 12, 2010
I have a START and STOP button in the main screen of an App. there are some GUI and threads that are instantiated when I click on START. When I click on stop, I want everything to be stopped and the activity should come back to its origin state. To the state that is exactly same like when launched (when we tapped on App icon in mobile).Is it possible to do this? I tried with finish() , this killed the app and exited . I don't want to exit from main screen. rather, on clicking STOP I want app to come back to origin or born state.
View 2 Replies
May 3, 2010
After implementing some Android Apps, including several Map activities, I try to refresh the activity when the GPS listener's onLocationChanged() mehtod is called. I have no idea how to tell the map activity to refresh on its own and display the new coords. the coords to store will have to be in global values, so that the location listener will have access to it. In my sample GPS-class (see code below) I just changed the text of a text view....but how to do that in map view?
View 2 Replies
View Related
Feb 18, 2014
if I use chrome and I go another app when I back to chrome all page refreash again.
I turn off I go to " settings - bandwidth management - preload webpapgs and I select never.
its same every time u out and back to chrome auto refresh.
View 2 Replies
View Related
Jul 22, 2009
What is the way to fresh an activity without calling finish- >startActivity all over again?
View 4 Replies
View Related
Oct 4, 2010
Since 2.2 upgrade if I do not open or delete any email in my in box I keep receiving new notifications on every refresh. Prior to upgrade one an email was downloaded from the pop3 server there would be no subsequent notifications. What can I do.
View 2 Replies
View Related
Sep 13, 2010
I have one activity. OnCreate the activity gets the source (html) of a web page to a string and presents the result (after parsing it a bit) in a textview. I would like the activity to reload/refresh periodically to always present the latest information.
View 1 Replies
View Related
Mar 24, 2009
I have created map view using XML layout in MapActivity and want to use this map view in another Activity group. I got mapview object in Acitivity group using GetWindow.Decorview(), MAP view is also displayed in the same layout of Activity Group. But without any image, only white background with some grid. Map view is not getting refreshed when i scroll on Map view. But if i launch independently MapActivity , i am able to see the map and it is getting refreshed when i scroll on the map. May I know how can i use and refresh Map view in an activity group? As Mapview can only be created/inflated in MapActivity.
View 2 Replies
View Related
Jun 7, 2010
I have an Android Activity with a RelativeLayout and I have implemented the following method to prevent the activity from being recreated on change of Orientation:
CODE:..............
I am obviously not doing anything in this method, but it worked perfect when using a LinearLayout. Now however, using RelativeLayout, my layout is all messed up when changing to landscape orientation.
What is the most efficient way to have the screen redraw correctly without having the activity restarted again with a call to onCreate?
View 2 Replies
View Related
Jul 24, 2010
I have a ListView that contains some data from sqllite table.the table is updated by some other process, and I would like to refresh it's data.The strange thing is that if I open another activity, then go back -it WILL refresh itself.
View 2 Replies
View Related
Jun 17, 2012
I have several textviews in an activity. I then have a button that I want to be able to click that will update the textview.
I want to do this without having to create multiple activities.
How do I go about I guess refreshing the current screen with new information?
View 7 Replies
View Related
Jan 21, 2010
I need to pass a value back to the same activity and refresh the activity to generate new data. Can anyone please provide me some ideas/guidance on how to do it?
I had try using intent to call the same activity but it doesn't work. Here is the code which i tried to use intent code...
View 1 Replies
View Related
Oct 26, 2012
I'm writing an application for Android and have multiple Activities, there are three to be exact. When a user drills down to the record they would like to view, they can modify it.
The issues is that when I click the back button to move to the previous screen, i'd like to refresh it to reflect the update performed by the end user. I can't figure out how to hook onto the appropriate event and then refresh my data on that view.
View 3 Replies
View Related
Feb 16, 2009
I have one Activity, that starts one Service and my service will lunch one Activity, i wanna to stop the Activity which one started my my Service after few seconds. Is there any way to achieve. Has anyone experienced this type of scenario.
View 5 Replies
View Related
Mar 19, 2010
My application contains three-four pages.On click of button in first page,I start a new activity which redirects to another page and second page redirects to third page and so on.Now I want to include one button which On click will redirect to first page by stopping all activities. So how to achieve that?
View 5 Replies
View Related
Aug 3, 2010
I want dont want the activity animation that comes by default when we start a new activity (i.e. the right to left scrolling effect to new activity view) so i googled a bit and found a flag FLAG_ACTIVITY_NO_ANIMATION in the Intent class also i applied that flag to my intent via the setflags() method but somehow i still see the activity animation when a new actvity is launced ( i am developing in android 2.1 update).
View 6 Replies
View Related
Dec 9, 2009
My problem is: Activity A called Activity B, and in Activity B, it start a background thread to do some client-server work. But it maybe takes too much time. So i add a cancel button to call the stop() method to stop the thread, and call finish() to finish the Activity B and go back to Activity A. Although it is back to Activity A, the thread isn't stop immediately. Can i just call the finish() to go back to Activity A, and leave the thread to exit by itself? If it is not the right way, which is?
View 10 Replies
View Related
Feb 10, 2009
I have an Activity which gives me the following stack trace error and it looks to be out of my control (I could be wrong though as I'm a newb to Android).Can anyone point me in the right direction? (It happened when I clicked on the back button)
View 2 Replies
View Related
Dec 7, 2009
I would like to know if there is a way to stop activity destruction upon physical keyboard slide in/out event.
View 4 Replies
View Related
Sep 21, 2010
1. press home key to stop my AP (activity change to stop , not destroy )
2. use "CountDownTimer" for sleep 3 secs , when timer finish use sendBroadcast() to call my BroadcastReceiver
3. finally , BroadcastReceiver use intent to start my AP (activity change to start).
View 3 Replies
View Related
Aug 12, 2010
Currently working on a simple app to allow users to find various things around them. When the activity that shows the Google map is active I can see the GPS icon on the status bar, which is normal. But I need to be able to stop the GPS hardware when my user navigates away from the activity, and switch the GPS back on when the activity is shown.
Is there a simple way to stop GPS when a user navigate away from an activity? I have tried the LocationManager's removeUpdates() but this doesn't actually stop the GPS (the icon is still flashing on the status bar and draining the battery).
What I'm looking for is a simple way to programatically stop the GPS hardware.
View 2 Replies
View Related
Feb 16, 2010
Can anyone tell me how to stop media player that was started in a previous activity?For ex. In activity-1 button pressed that did - mp.start(); then activity-2 starts for different layout with new buttons, then when button pressed, mp.stop is called, but does not stop the media from the first activity.
View 4 Replies
View Related
Mar 27, 2010
I have an AsyncTask object which starts executing when the activity is created and does stuff in the background (downloads upto 100 images). Everything works fine but there is this peculiar behavior which i'm not able to understand.For eg: when the android screen's orientation changes then the activity is destroyed and created again. So I override the onRetainNonConfigurationInstance() method and save all the downloaded data executed in the AsyncTask. My purpose of doing this is to not have AsyncTask run each time activity is destroyed-created during orientation changes, but as i can see in my logs the previous AsynTask is still executing. (The data is saved correctly though)I even tried to cancel the AsynTask in the onDestroy() method of the activity but the logs still show AsynTask as running.This is really strange behavior and would really be thankful if someone can tell me the correct procedure to stop/cancel the AsynTask.
View 1 Replies
View Related
Sep 2, 2010
I have an application that must create a database and if that fails, then no sense moving forward. I've built an AlertDialog and show() it but it never displays. The logic falls through and then barfs because of the missing database.What is the right/best way to throw up a message and halt the activity? The code below executes fine (meaning the show() occurs while debugging and it falls to the next line) but the UI never displays this alert.BTW I realize the throw might not be the most graceful but I'm not even getting that far so.
View 2 Replies
View Related
Apr 17, 2010
In Android, I have some code to check whether the user has GPS switched on, and launch the Settings for them to turn it on if they don't.However, I'm finding that if the user opens the Settings, turns GPS on, then carries on using the app as normal, there is an odd problem. Often, when the user reopens the app, the Settings are at the front. How can I set them so they don't keep reappearing?I wonder if I should be using the CLEAR_TOP flag or something similar.I've tried looking at the docs for the Activity flags but find them a bit confusing.
View 1 Replies
View Related
Oct 11, 2009
I have started dialer activity with code
Intent myIntent = new Intent(Intent.ACTION_CALL, Uri.parse(createTelUrl("1234567"))); startActivityForResult(myIntent);
Is there a way to stop the dialer activity from same code.? Logically it should be possible as i started it and i should have rights to stop it as well.
View 5 Replies
View Related
Nov 10, 2010
I have a Timer which executes a TimerTask every 30 seconds. I only want the timer to launch a new TimerTask if the Activity is displayed i.e. if the user receives a phone call or launches a new activity the Timer will stop. I then need the Timer to restart when the Activity is re-launched and comes into focus.
Now this should be easy, I override the "onWindowFocusChanged(boolean hasFocus)" method and either start or stop the timer depending on the value of has Focus. The way I start the timer is to create a new Timer object and TimerTask each time and the way I stop the Timer is to call the cancel() method on the Timer object and set timer to null.
My problem is this doesn't always work, if I launch the activity which has the Timer and switch orientations quickly (to start/stop the Activity) I find the Timer is not always canceled and I end up with multiple Timers launching TimerTasks at an ever increasing rate.
View 2 Replies
View Related
Aug 31, 2010
Just like the title says, Is there a simple line of code I could add to onStop()that will simply stop any gps activity currently going on with my application?
View 1 Replies
View Related
Nov 3, 2010
Im wanting to stop all threads when my main activity closes as some are still running afterwards and are giving NullPointerException as they try to access Array Lists which no longer exist. however none of the obvious methods are working and they are also deprecated. is it possible as im currently using a try/catch statement as a workaround but would prefer a fix.
View 1 Replies
View Related
Sep 15, 2010
I have a enable and disable button. When this button is enable, user can launch my application normally. But when the button is in disable state, I don't want to start the application, that is the launcher activity should not start, but the icon for application will be there.When we click on the icon for application to launch it should not start.
View 3 Replies
View Related
Sep 22, 2010
How to bring stop activity to foreground (restart) by itself?i use Broadreceiver and intent to restart my activity.but always start two activity (include original activity)how to restart my original activity?
View 4 Replies
View Related