设为首页 加入收藏

TOP

Android子线程在没有ViewRoot的情况下能刷新UI吗?(二)
2014-11-24 12:42:41 来源: 作者: 【 】 浏览:1
Tags:Android 线程 没有 ViewRoot 情况 刷新
ing another activity.


if (!r.activity.mFinished && willBeVisible


&& r.activity.mDecor != null && !r.hideForNow) {


if (r.newConfig != null) {


if (DEBUG_CONFIGURATION) Slog.v(TAG, "Resuming activity "


+ r.activityInfo.name + " with newConfig " + r.newConfig);


performConfigurationChanged(r.activity, r.newConfig);


r.newConfig = null;


}


if (localLOGV) Slog.v(TAG, "Resuming " + r + " with isForward="


+ isForward);


WindowManager.LayoutParams l = r.window.getAttributes();


if ((l.softInputMode


& WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION)


!= forwardBit) {


l.softInputMode = (l.softInputMode


& (~WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION))


| forwardBit;


if (r.activity.mVisibleFromClient) {


ViewManager wm = a.getWindowManager();


View decor = r.window.getDecorView();


wm.updateViewLayout(decor, l);


}


}


r.activity.mVisibleFromServer = true;


mNumVisibleActivities++;


if (r.activity.mVisibleFromClient) {


r.activity.makeVisible();


}


}



r.nextIdle = mNewActivities;


mNewActivities = r;


if (localLOGV) Slog.v(


TAG, "Scheduling idle handler for " + r);


Looper.myQueue().addIdleHandler(new Idler());



} else {


// If an exception was thrown when trying to resume, then


// just end this activity.


try {


ActivityManagerNative.getDefault()


.finishActivity(token, Activity.RESULT_CANCELED, null);


} catch (RemoteException ex) {


}


}


}


最后,提个问题结束吧:activity.onStart里通过线程刷新UI能成功吗?别回答太快哟!好好想想!


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Android里子线程真的不能刷新UI吗.. 下一篇在桌面红旗Linux6上编写并运行第..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C++中智能指针的性能 (2025-12-25 03:49:29)
·如何用智能指针实现c (2025-12-25 03:49:27)
·如何在 C 语言中管理 (2025-12-25 03:20:14)
·C语言和内存管理有什 (2025-12-25 03:20:11)
·为什么C语言从不被淘 (2025-12-25 03:20:08)