反射另一个app中的View
FrameLayout fl = (FrameLayout) findViewById(R.id.content);
View v = null;
try {
  Context context = createPackageContext("com.sohu.news", Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY); 
  int id = context.getResources().getIdentifier("activity_main", "layout","com.sohu.news"); 
  v = LayoutInflater.from(context).inflate(id, null); 
  v.setTag(this); 
} catch (NameNotFoundException e) { 
  e.printStackTrace(); 
} 
if (v != null) { 
  fl.addView(v); 
}
 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号