如何获得活动的内容有何看法? [英] How to get Activity's content view?

查看:128
本文介绍了如何获得活动的内容有何看法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

告诉我,我应该叫什么方法来获取知道,如果活动有它的内容查看,我的意思是方法的setContentView()已经做了?

解决方案

  this.getWindow()。getDecorView()。findViewById(android.R.id.content)
 

  this.findViewById(android.R.id.content)
 

  this.findViewById(android.R.id.content).getRootView()
 

Tell me, what method should I call to get know if Activity has it's contentView, I mean method setContentView() has been done?

解决方案

this.getWindow().getDecorView().findViewById(android.R.id.content)

or

this.findViewById(android.R.id.content)

or

this.findViewById(android.R.id.content).getRootView()

这篇关于如何获得活动的内容有何看法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆