设为首页 加入收藏

TOP

Android子线程在没有ViewRoot的情况下能刷新UI吗?(二)
2014-11-24 12:42:41 来源: 作者: 【 】 浏览:4
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上编写并运行第..

评论

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

·Libevent C++ 高并发 (2025-12-26 00:49:30)
·C++ dll 设计接口时 (2025-12-26 00:49:28)
·透彻理解 C 语言指针 (2025-12-26 00:22:52)
·C语言指针详解 (经典 (2025-12-26 00:22:49)
·C 指针 | 菜鸟教程 (2025-12-26 00:22:46)