I am pretty sure that Android services will be the end for me. I have almost no hair left after the last few days ....
... anyway, I'm distracted.
At first, I had a hell of a time to get the service to bind to a button with a button, getting it from yesterday's help. Now I really want the service to communicate in the onCreate () method. This part is not a problem, it works as intended. My service is actually a socket service for connecting TCP sockets to the socket server that I wrote. If I put a method call from the associated service mBoundService.StartSocketServer () inside the button, then bingo works fine. But I need this to work immediately when the activity loads, so right under my call to bindService () inside my onCreate () method. When I place a call to start a socket inside my onCreate (), I get a forced close.
This method (StartSocketServer ()) spawns a new thread and opens a socket in this thread on my remote computer. I assume the problem is to generate a new thread before the activity is fully loaded ... not sure.
LogCat is rather mysterious here. It really speaks of an unsuccessful attempt to connect threads, and then shows an exception of an excluded handler, which is "caused by: java.lang.NullPointerException" in it.
Again, if I put this call on the method inside the button click, I will work in the business if it does not work in onCreate (). Is there some way inside the action (assuming my assumption is true that it needs to be fully loaded before a new thread appears) to call StartSocketServer () after loading it: ala body.onLoad () in html?
, :)