开发者

Can I include code from one file to the next, similar to Includes in html

开发者 https://www.devze.com 2023-04-13 10:01 出处:网络
Ok, Please be gentle and kind.I am taking an Android Programming class in college and its our teachers first semester so he is learning as we are... Nothing against him, he\'s a good teacher, just doe

Ok, Please be gentle and kind. I am taking an Android Programming class in college and its our teachers first semester so he is learning as we are... Nothing against him, he's a good teacher, just doesn't know the answer.

I don't know how to put this in Android/java language so here goes...

Is there a way to use something similar to Includes, in web design, in Android. I am looking to add similar java code from one activity to the next, can i make a file that if i change this one file it will change in all the files its included it.

I know it can be done with the XML files but i couldn't find anything to show that it can be done开发者_如何学Go in the actually coding... but then again i don't know the correct terminology. Please any help would be great. And thank you for taking the time to read and answer me. I apologize if this was somewhere else, I just couldn't find it.. Thanks again


Put anything you wish to "include" in Java classes, then import them. http://leepoint.net/notes-java/language/10basics/import.html


Android Programming class! I would've loved that in University...

Regardless, if you're using Eclipse for your IDE, it should pickup any changes from your java imports automatically. If you choose to refactor other java classes within your project, a rename for example (with "Update All References"), will update all references to that class across your project.

You could also use Maven (dependency management) to pull the latest third-party (or other) .jars at build time, if that's applicable to what your needs are.

:)

0

精彩评论

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

关注公众号