这是我的计划。
public class MathsExplorer extends Activity {
/** Called when the activity is first created. */
private GraphicsView view;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(view);
}
}
public class GraphicsView extends View {
public GraphicsView(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
public void onDraw(Canvas canvas)
{
super.onDraw(canvas);
String background = "/Maths Explorer/bin/res/drawable/MC900436279.jpg";
Bitmap b = BitmapFactory.decodeFile(background);
canvas.drawBitmap(b, 10, 10, null);
}
}
它立即退出并出现错误“不幸的是,数学资源管理器已停止。”
任何人都可以帮助我吗?我不确定,我只是想显示图像。