Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set xml file from sd card as layout in android

In my application i want to get layout file from server and set that file as content view of activity.I want to know whether it is possible..For this what i had in mind is I'll download file from server and will store it in SD card and will access it from there.But is it possible to set the file as content view..Please help me..

like image 444
android Avatar asked Oct 24 '22 10:10

android


1 Answers

No,Its not possible.

To set xml file as layout in your activity you have that file in res/layout directory and also make sure its id entry in R.java files.

Without keeping it in res/layout you can't apply it as a layout to your activity.

EDIT:

Basically when you put any xml layout file in res/layout then its id entry created in public static final class layout in R.java files, And from there when you set that file as a contentView() of your activity or inflate it, the android nutshell make a view from that raw layout xml file and apply it to your activity.

like image 80
user370305 Avatar answered Nov 03 '22 22:11

user370305