反射另一个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); }