KIRAN K J
KIRAN K J

Reputation: 732

How to get layout from another package in android?

I start a project MyFileChooser which contains package com.MyFileChooser.In my Project i have a layout abc.xml.I created another package com.FileChooser in the same project.In a class file inside the second package,i need to set abc.xml layout.But it is not possible to do so.Also i cannot acces the EditText inside abc.xml.

Upvotes: 0

Views: 1423

Answers (2)

sAaNu
sAaNu

Reputation: 1508

just import

import com.MyFileChooser.R;

Upvotes: 1

Bhavin
Bhavin

Reputation: 6010

Try to get layout by setContentView(R.layout.abc); now you can get all the tools of abc.xml by findviewbyid.

And no need to give any kind of Reference. Now just go to Project->Clean the Project before you Build.

Upvotes: 0

Related Questions