dhkim1027
7/19/2017 - 9:44 AM

addView or inflate from another package's layout From https://stackoverflow.com/questions/13218819/load-resource-layout-from-another-apk-dyn

Context c = createPackageContext(foreignPackageName,
    Context.CONTEXT_INCLUDE_CODE|Context.CONTEXT_IGNORE_SECURITY); //create foreign context
int resId = c.getResources.getIdentifier(mylayoutName,"layout",foreignPackageName); 
LayoutInflater myInflater = LayoutInflater.from(c); //Inflater for foreign context
View myLayout = myInflater.inflate(resId,null,false); //do not attach to a root view