开发者

Android how to call layout events in other class? [closed]

开发者_高级运维 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I have main.xml, mainActivity.java class file and Book.java class file, I want to use button click event (which is from main.xml) in Book class file. How can I do this?


Well i'm a little short on info here. But it seems you have to copy/paste the code in your onClickListener and put it inside you Book class buttons onClickListener. Another solution which i dont think is a great solution is that you put your action in a public static method, this way you'll be able to acces it from your Book class. If this doesn't make sense, please post your code and xml files. And elaborate your question.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜