Reputation: 1855
I have two android projects 1. Main Project 2. Library project. I am referring the Library project in my Main project. I have a fragment in Main Project which should use the layout(.xml) file in library project. How can I achieve this?
Upvotes: 6
Views: 4624
Reputation: 31468
if you want to use it inside your code you can refer to it like this:
com.library_package.R.layout.library_layout
so for example you can inflate layout with:
LayoutInflater.from(context).inflate(com.library_package.R.layout.library_layout, this, true);
Upvotes: 11