I am trying to make an ImageView be a surface that I can draw on with my finger.
I have followed Android 2D Graphics Example, which resulted in making a whole screen drawable (with some issues, discussed in question 8287949, but somewhat disconnected from what I am trying to do.)
I am working with:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceStatA);
// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
// requestWindowFeature(Window.FEATURE_NO_TITLE);
drawView = new DrawView(this);
drawView.requestFocus();
setContentView(R.layout.activity_main);
}
I'm thinking I need to change drawView = new DrawView(this)
to something that would reference the Context of the resource I define in activity_main.xml
:
ImageView
android:id="@+id/canvasview"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_alignParentLeft="true"
android:layout_below="@+id/btnRed"
android:background="@drawable/kitty"
However, I either don't know what I'm looking for in the API reference, or I'm not finding it.
The class for DrawView is documented at Android 2D Graphics Example, so I won't repeat it here.
I have been working through AppInventor, and trying to duplicate what I learn there in Eclipse using the real Android SDK, but I'm feeling stumped on Tutorial #1, so sorry for the newbie question!