android代码,我无论如何也无法在主线程中等待dialog的出现
fuck=newThread(newRunnable(){publicvoidrun(){Log.v("fuck000","我已经运行,但没弹出来000");Intent...
fuck= new Thread(new Runnable() {
public void run() {
Log.v("fuck000", "我已经运行,但没弹出来000");
Intent smsdialog = new Intent(AWords.mainform, yesnoActivity.class);
smsdialog.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AWords.mainform.startActivity(smsdialog);
//sql.thisme.startActivityForResult(smsdialog,1);
Log.v("fuck222", "我已经运行,但没弹出来222");
}
});//.start();
fuck.start();
}
synchronized (Thread.currentThread()) {
while (yesnoActivity.result==-1){
//Thread.currentThread().suspend();
Thread.currentThread().notify();
try {
fuck.wait();
} catch (InterruptedException e) {
}
}
}
上面的android代码,我无论如何也无法在主线程中等待dialog的出现,主线程只能阻塞。有人知如何实现吗? 展开
public void run() {
Log.v("fuck000", "我已经运行,但没弹出来000");
Intent smsdialog = new Intent(AWords.mainform, yesnoActivity.class);
smsdialog.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AWords.mainform.startActivity(smsdialog);
//sql.thisme.startActivityForResult(smsdialog,1);
Log.v("fuck222", "我已经运行,但没弹出来222");
}
});//.start();
fuck.start();
}
synchronized (Thread.currentThread()) {
while (yesnoActivity.result==-1){
//Thread.currentThread().suspend();
Thread.currentThread().notify();
try {
fuck.wait();
} catch (InterruptedException e) {
}
}
}
上面的android代码,我无论如何也无法在主线程中等待dialog的出现,主线程只能阻塞。有人知如何实现吗? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询