Custom view를 사용해서 레이아웃을 구성하고 있습니다.
그런데 main.xml 에서 이러게 보여도 관계없나요?

그리고
NullPointerException:null 이라고 보이는 원인 좀 말씀해주시면 감사하겠습니다.





그리고 밑에는 소스 파일 입니다.


-----------------------------------------------------------------------------------
MyGraphic2D0102.java 파일입니다.

package my.MyGraphic2D0102;

import android.app.Activity;
import android.os.Bundle;

public class MyGraphic2D0102 extends Activity {
private CustomView customview;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        customview = (CustomView)findViewById(R.id.myview);
    }
}
-----------------------------------------------------------------------------------
CustomView.java 파일입니다.

package my.MyGraphic2D0102;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.util.Log;
import android.view.View;

public class CustomView extends View{

public CustomView(Context contex, AttributeSet attrst) {
super(context, attrst);
// TODO Auto-generated constructor stub
}
@Override
public void onDraw(Canvas canvas){
Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
canvas.drawColor(Color.parseColor("#dedede"));
canvas.drawBitmap(bm,70,70,null);
}
}
-----------------------------------------------------------------------------------
main.xml 파일입니다.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
<my.MyGraphic2D0102.CustomView
  android:id="@+id/myview"
  android:layout_width="fill_parent"
  android:layout_height="330px" />

</LinearLayout>