Click here to Skip to main content
14,868,806 members
Home / Discussions / Android
   

Android

 
GeneralRe: Application Architecture Pin
Dominic Burford27-Oct-14 6:50
professionalDominic Burford27-Oct-14 6:50 
GeneralRe: Application Architecture Pin
ericgahn27-Oct-14 7:16
Memberericgahn27-Oct-14 7:16 
GeneralRe: Application Architecture Pin
Dominic Burford27-Oct-14 7:20
professionalDominic Burford27-Oct-14 7:20 
GeneralRe: Application Architecture Pin
ericgahn27-Oct-14 8:15
Memberericgahn27-Oct-14 8:15 
GeneralRe: Application Architecture Pin
dr.samuel.john27-Oct-14 8:04
Memberdr.samuel.john27-Oct-14 8:04 
QuestionSetBackroundDrawable? Pin
András Ferencz18-Oct-14 10:02
MemberAndrás Ferencz18-Oct-14 10:02 
Questionremote desktop sharing Pin
Member 1101928217-Oct-14 20:35
MemberMember 1101928217-Oct-14 20:35 
QuestionService not always being restarted after being stopped Pin
NormR112-Oct-14 5:18
MemberNormR112-Oct-14 5:18 
I'm developing an app for my tablet that is to turn on the screen when I rotate it to the vertical (the power switch is dodgy). It has an optimization to turn off the sensor from 22:00 to 06:30. The app works most of the time. However sometimes it fails. For example this morning I picked it up at 07:10 and the screen came on as expected. I put it down for about a half an hour and when I picked it up again it did not come on. I plugged in the power and it came on. I stopped my service and restarted it then and it has been running fine: pick up and it comes on when the screen has gone off.

Looking at the logs I see that the system stops the service frequently(maybe every 30 minutes) and then restarts it, passing a null intent to the onStartCommand() method. I've used SharedPreferences to save the app's state and am able to successfully restart the app where it needs to be.

My question: why didn't the app work this morning after it had worked on the first pickup of the morning? Any ideas on how to debug this or any work-arounds?


It's a very elusive bug. The code works so many times and fails so few times that I'm not able to come up with a debugging scheme to find out a reason or pattern for the failure.
Do you have any suggestions?

Something I've observed by looking at the logs is that the system restarts my service (passing a null intent to the onStartCommand() method) very soon after I have plugged in the tablet to turn on the screen. How would a bug in my code cause that?

Another observation: the system often restarts my service 5 seconds after the AlarmReceiver is supposed to receive an alarm: at 22:00:05 for an alarm set for 22:00:00.

Also posted at: http://www.codeproject.com/Questions/826395/Service-not-always-restarted-on-ASUS-tablet?cmt=683080#cmt2_826395
AnswerRe: Service not always being restarted after being stopped Pin
gupta.avinash16-Oct-14 7:09
professionalgupta.avinash16-Oct-14 7:09 
GeneralRe: Service not always being restarted after being stopped Pin
NormR116-Oct-14 7:17
MemberNormR116-Oct-14 7:17 
AnswerRe: Service not always being restarted after being stopped Pin
gupta.avinash16-Oct-14 8:25
professionalgupta.avinash16-Oct-14 8:25 
GeneralRe: Service not always being restarted after being stopped Pin
NormR116-Oct-14 8:35
MemberNormR116-Oct-14 8:35 
Questionweb developer Pin
Member 111167273-Oct-14 0:21
MemberMember 111167273-Oct-14 0:21 
AnswerRe: web developer Pin
Richard MacCutchan3-Oct-14 2:53
mveRichard MacCutchan3-Oct-14 2:53 
AnswerRe: web developer Pin
David Crow7-Oct-14 3:33
MemberDavid Crow7-Oct-14 3:33 
AnswerRe: web developer Pin
jorgesys9-Oct-14 8:57
Memberjorgesys9-Oct-14 8:57 
AnswerRe: web developer Pin
Dominic Burford10-Oct-14 4:55
professionalDominic Burford10-Oct-14 4:55 
Questiondetect when the dialog is load in android - And do something in response to Pin
goldsoft2-Oct-14 5:07
Membergoldsoft2-Oct-14 5:07 
AnswerRe: detect when the dialog is load in android - And do something in response to Pin
Richard MacCutchan2-Oct-14 5:22
mveRichard MacCutchan2-Oct-14 5:22 
GeneralRe: detect when the dialog is load in android - And do something in response to Pin
goldsoft2-Oct-14 5:46
Membergoldsoft2-Oct-14 5:46 
GeneralRe: detect when the dialog is load in android - And do something in response to Pin
Richard MacCutchan2-Oct-14 6:01
mveRichard MacCutchan2-Oct-14 6:01 
GeneralRe: detect when the dialog is load in android - And do something in response to Pin
goldsoft3-Oct-14 0:34
Membergoldsoft3-Oct-14 0:34 
QuestionRe: detect when the dialog is load in android - And do something in response to Pin
Richard MacCutchan3-Oct-14 2:51
mveRichard MacCutchan3-Oct-14 2:51 
AnswerRe: detect when the dialog is load in android - And do something in response to Pin
goldsoft4-Oct-14 0:25
Membergoldsoft4-Oct-14 0:25 
GeneralRe: detect when the dialog is load in android - And do something in response to Pin
Richard MacCutchan4-Oct-14 0:47
mveRichard MacCutchan4-Oct-14 0:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.