Questions tagged [onresume]

onResume is an Activity life-cycle event generated by the Android OS when an Activity becomes the top-most one in the stack.

onResume is an Activity life-cycle event generated by the Android OS when an Activity becomes the top-most one in the stack.

More can be read about this at the Android Developer Site.

712 questions
0
votes
1 answer

Toggle state from broadcast recive android

I have a toggle that when BATTERY_LOW is true turns off the wifi: public void getToggle(View view) { // Is the toggle on? boolean on = ((ToggleButton) view).isChecked(); if (on) { PackageManager pm = getPackageManager(); …
David_D
  • 1,404
  • 4
  • 31
  • 65
0
votes
2 answers

Android ListView does not update onResume

I made an Activity for searching people that also shows history of recent research. If I long click on an item of the history it asks me if I want to delete it. If I press "Yes" it deletes the list item. So, I write something and click to "Search"…
Egidio Caprino
  • 553
  • 10
  • 18
0
votes
1 answer

How can i check the state of toggle button for wifi?

In my application i have a toggle button that needs to activate or disable the wifi. public void getRisparmio(View view) { // is the toggle on? boolean on = ((ToggleButton) view).isChecked(); WifiManager wifiManager; if (on) { …
David_D
  • 1,404
  • 4
  • 31
  • 65
0
votes
1 answer

Android - WebView dies on resume

I have Activity with some data displayed in WebView that I load with WebView#loadDataWithBaseURL Then I have/click menu option that fires android.content.Intent.ACTION_SEND Choose email from the chooser Google email comes up (as expected) Discard…
Bostone
  • 36,858
  • 39
  • 167
  • 227
0
votes
1 answer

how to know when the application comes to foreground in android

i am developing an android app in which i've used tabhost for tabbar in each tab i've hosted FragmentActivity which in turn hosts different fragments i am getting data from server via network calls and while sending each call i've to send the…
Khurram Shehzad
  • 1,010
  • 12
  • 16
0
votes
1 answer

Android: Unable to resume Activity, java.lang.RuntimeException

I have an activity that has a ListView implemented using a SimpleCursorAdapter. The ListView lists items from an SQLite Database. The problem is the it the I am reaching this activity on the press of a button from MainActivity. If there are no…
tintin
  • 151
  • 1
  • 2
  • 13
0
votes
1 answer

android: creating method in onCreate() running in onResume()

I've created a onClickListener in the onCreate() state. Once the program is running I'm in onResume() state, how come when I call the onClickListener in the onResume() state it works? Shouldn't there be a distinction between the states: import…
Carlo Luther
  • 2,402
  • 7
  • 46
  • 75
0
votes
1 answer

how to call on resume when activity is destroyed?

I have activity A which creates list view and has onResume action to update adapter. protected void onResume() { super.onResume(); ma.notifyDataSetChanged(); Log.d("resumed","true"); } Also I have activity B. How…
Yarh
  • 4,459
  • 5
  • 45
  • 95
0
votes
2 answers

Stop LoginActivity from popping out onResume()

I got two activities.....LoginActivity(Launcher Activity) and MainActivity. When the app is installed and started the LoginActivity is invoked and on entering the username and password, it authenticate from a server and starts the MainActivity. This…
ASP
  • 3,645
  • 1
  • 31
  • 45
0
votes
1 answer

Avoiding Call to OnCreate of background activity by pressing back of finish from Foreground Activity

I have two activity A and B. I am calling B activity from A by pressing a Button. But when i press back button from B activity or call finish then it calls onCreate of activity A. I dont know why it is happening. Both the activities have data.…
Varun Vishnoi
  • 328
  • 6
  • 23
0
votes
1 answer

Android App runs perfectly when ran after installation, but shows white screen on second run?

I used an idea from first answer to this question in order to pause and resume drawing on canvas. It worked well, but a new problem that I'm facing is, app is not starting up if I press Home button and start it again. I've called onResume() when…
Ravi Ojha
  • 722
  • 1
  • 6
  • 15
0
votes
2 answers

Logging in Activity, postOnExecute, Resume

I need to implement auto-login process from an activity. Also I need to show ProgressDialog while logging in. I use AsyncTask for login process, because I haven't succeeded to show ProgressDialog in other way, and I execute the mentioned AsyncTask…
smb
  • 834
  • 1
  • 8
  • 17
0
votes
0 answers

Activity killed in background and ClassCastException when resumed?

This only happens after the activity has been in the background for some time. It does not happen if I press the "home" button and then a few seconds later reopen the app, restoring the previous state. It does happen when I press the"home" button…
wufufufu
  • 83
  • 2
  • 9
0
votes
1 answer

Why does this class, when the method onResume is called, give error NullPointerException?

public class Scores extends Activity { TextView tvPoints; TextView tvRecord; int record = 0; int points = 0; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub …
DomeWTF
  • 2,342
  • 4
  • 33
  • 46
0
votes
2 answers

Semi-persisting data for one screen only

what Iam doing is a simple game which when beaten, goes to a new activity, there it starts a AsyncTask and submits user score to the server, server responds with a array of scores (few better than me, me, few worse than me). What I want to do is…
urSus
  • 12,492
  • 12
  • 69
  • 89