동적생성1 Android Studio , 동적 뷰 생성 시 많이 접하는 Exception / java.lang.IllegalStateException: The specified child a already has a parent. You must call removeView() on the child's parent first 뷰들을 동적 생성하면서 흔히 접하는 Exception 이 있다. 위 경우는 TableLayout 을 생성하는 경우이다. TableRow 를 생성해서 TextView 로 속성값을 생성하여 addView() 하고 완성된 한 행을 TableLayout 에 addView 를 하는 것이다. java.lang.IllegalStateException: The specified child a already has a parent. You must call removeView() on the child's parent first 이 예외는 이미 한번 addView 한 View 타입을 한번 더 addView 할 때 발생한다. (중복 추가) TableRow 한 행을 완성한 후 TableLayout 에 addView 하는 것.. 2021. 9. 12. 이전 1 다음