这是我班级中的 onCreate(...) 方法:
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.editor);
setRequestedOrientation(1);
v = new SView(this);
v.setOnTouchListener(this);
//v.setZOrderOnTop(true);
//v.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
setContentView(v);
ImageView back = (ImageView) findViewById(R.id.IVEditor);
bm = loadPhoto("photo", bm);
if(bm != null)
{
//This Section is giving me the error
back.setImageBitmap(bm);
}
}
这是错误,当我双击它时,它会将我带到上面的单独部分。我不知道为什么:
11-09 07:42:42.624: E/AndroidRuntime(32472): Caused by: java.lang.NullPointerException
11-09 07:42:42.624: E/AndroidRuntime(32472): at com.synlight_development.tattoo_it.Editor.onCreate(Editor.java:64)
11-09 07:42:42.624: E/AndroidRuntime(32472): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
11-09 07:42:42.624: E/AndroidRuntime(32472): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1785)
11-09 07:42:42.624: E/AndroidRuntime(32472): ... 11 more