Access another view's content from another view
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...
精彩评论