Dear Android developers,
I am having the following issue in Android:
In one class I am having:
--------------------------------------------
final Object lock = new Object();
Thread thread;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
thread = new Thread() {
@Override
public void run() {
sendRequest("foo");
synchronized(lock) {
try { lock.wait(); } catch (InterruptedException e) {
e.printStackTrace(); }
}
System.out.println("GOT HERE!!!");
------------------------
which causes the sendRequest() to do a bunch of stuff. When such stuff
finishes I call:
System.out.println("Notifying thread...");
synchronized(lock) {
lock.notify();
}
System.out.println("Thread notified.");
-------------------------
and this code executed until the "Thread notified." println()
statement. But then I do
not see the waiting thread resume from where I called wait(). Here is the output
from adb logcat:
I/System.out( 2395): Thread notified.
W/ActivityManager( 60): Launch timeout has expired, giving up wake lock!
I do not see where I am going wrong. Any ideas why the code is not
working as expected?
Thanks,
John Goche
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en