안드로이드 개발 질문/답변
(글 수 45,052)
public class Test extends Activity { Ball m_bbview; private int m_level; Resources m_resource; XmlPullParser parser; AttributeSet attributes; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); m_resource=getResources(); parser = m_resource.getXml(R.layout.playgame); // <== 제가 화면에 띄우고싶은 xml파일임 attributes = Xml.asAttributeSet(parser); m_bbview = new Ball(this,attributes); setContentView(m_bbview); } public class Ball extends View { public Ball(Context context, AttributeSet attrs) { super(context,attrs); LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); // TODO Auto-generated constructor stub } } }
이렇게 소스가 되어있는데여 이상태로 실행을 하면 화면은 검은색배경만 나오네요... 어떤 내용이 빠진건지 모르겟네요,,ㅠㅠ
Ball 클래스에서 상속받은 View자체가 제가 만든 R.layout.playgame 가 되게 하고싶은게 저의 질문이네요..
또한 제가 만든 레이아웃이 LinearLayout 레이아웃이면 View 대신에 LinearLayout를 상속받아야되나요?