开发者

Access another view's content from another view

开发者 https://www.devze.com 2023-02-13 19:23 出处:网络
I have an activity with two view.One view has the buttons and the other is main view.I must disable buttons for some circumstances inside main view.I couldn\'t figure o开发者_开发百科ut how to do that

I have an activity with two view.One view has the buttons and the other is main view.I must disable buttons for some circumstances inside main view.I couldn't figure o开发者_开发百科ut how to do that.


Button myBtn = (Button) ((MyActivity)getContext()).findViewById(R.id.mybtn);

I was calling this code inside constructor of my view.

That's why it's not working. Now it's working...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号