Download the graphic android.png

- To set background of a View
Add a View in main.xml, and set thr background to "@drawable/android"
<View
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/android"
/>
- Using ImageView
Add a ImageView in main.xml
<ImageView
android:id="@+id/myImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
Add the code in onCreate(), after setContentView(R.layout.main)
ImageView MyImageView = (ImageView)findViewById(R.id.myImageView); MyImageView.setImageResource(R.drawable.android);
Both have the same result.

Thank you for reading this article Display a drawable graph, using ImageView. With URL https://x-tutorials.blogspot.com/2009/10/display-drawable-graph-using-imageview.html. Also a time to read the other articles.
0 comments:
Write your comment for this article Display a drawable graph, using ImageView. above!