0

Friends. I want know is there any way to create a directory in android studio.And the call that directory in MainActivity like.

R.layout.my layout;

insted of that I want

R.(my directory).mylayout;
  • I believe this is something you are looking for (pretty informative answer there): http://stackoverflow.com/questions/4930398/can-the-android-layout-folder-contain-subfolders – Shaishav Aug 12 '16 at 10:00

2 Answers2

0

Yes you can do it. For instance if you want to read a csv file in your project. Then make a folder in the res folder of your project (let's name this folder raw). Then place a file in the folder. So the folder structure will be something like this res->raw->evolver.csv.

Now to read this file, you can do something like this to read this file.

InputStream inputStream = getResources().openRawResource(R.raw.evolver);

Here "evolver" is the name of the file that I placed in the folder res->raw.

Vipul Behl
  • 644
  • 1
  • 7
  • 20
0
  • Right Click on your layout folder and create new folder name it whatever you want.
  • Add whatever file you want to access in your folder.
  • To Access your file type R.layout.(your Directory).

this should do it

Mayank Wadhwa
  • 1,673
  • 17
  • 20