1. 程式人生 > >Activity 獲取 view getContentView

Activity 獲取 view getContentView

public static View getContentView(Activity ac){
       ViewGroup view = (ViewGroup)ac.getWindow().getDecorView();
       FrameLayout content = (FrameLayout)view.findViewById(android.R.id.content);
       return content.getChildAt(0);
}