Ulf Dittmer wrote:The problem is that you did not do exactly what that tutorial says to do. You made a mistake with the command you used, which is what Steve and I are trying to alert you to. So I'll say it again: look very carefully at every single part of the command you used.
Steve Luke wrote:
fahimeh hashemian wrote:
Ulf Dittmer wrote:Carefully look at each part of the command you're entering, and ask yourself: is that correct?
I read my comments and i think, this is true! what you mean? which part of my question is incorrect?
What are the available options for the -list command?
Ulf Dittmer wrote:Carefully look at each part of the command you're entering, and ask yourself: is that correct?
No, I specifically said that the onClick event shouldn't do that! Don't do that. The onResume() method should be called only as part of the Activity Live Cycle, not arbitrarily by your code. Go back and read what I said, and do that.
And remember that you will need to cancel any tasks already running, but there is NO need to kill the timer each time, you can re-use it (it would be nice to purge it though).
Steve Luke wrote:
fahimeh hashemian wrote:but onResume call when changed value of sensor!
What does that mean? What sensor are you talking about?
where should i move my code that fix in period and delay in onResume()?
You need code to execute when onResume() is called, and when the buttons are pushed. The buttons being pushed do not cause onResume() to be called (nor should they). So what should you do? Move the code to its own method. Call the method from onResume() and the OnClickListener's onClick() method.