왜이 간단한 예제에서 마지막 문 (setBackgroundColor) 이 응용 프로그램의 충돌을 생성합니까?응용 프로그램의 예기치 않은 중단
public class Macumba extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView vista = (ImageView)findViewById(R.id.vista);
vista.setBackgroundColor(Color.YELLOW);
}
}
main.xml에도 매우 간단하다 :
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
android:id="@+id/widget0"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<ImageView
android:id="@+id/vista"
android:layout_width="300px"
android:layout_height="330px"
android:layout_x="9px"
android:layout_y="8px"
/>
</AbsoluteLayout>
충돌시 어떤 예외가 발생하는지 – Relsell
알려주세요. –