Application crashing when rendering sprites on Android
<p>I have recently been trying to learn Android programming in order to enhance my portfolio</p>

<p>I've built a couple of simple text based applications and have now decided to extend this into game programming</p>

<p>I've coded the following which should display the sprite named droid_1.png on screen</p>

<pre><code>    public class IconApp extends Activity {
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            requestWindowFeature(Window.FEATURE_NO_TITLE);
            setContentView(new Panel(this));
        }

        class Panel extends View
        {
            public Panel(Context context)
            {
                super(context);
            }

            @Override
            public void onDraw(Canvas canvas)
            {
                Bitmap BMap = BitmapFactory.decodeResource(getResources(),  R.drawable.droid_1);
                canvas.drawColor(Color.CYAN);
                canvas.drawBitmap(BMap, null, null);
            }
        }
    }
</code></pre>

<p>Eclipse doesn't flag any errors but when I run the application, it crashes</p>

<p>My main.xml file under my layout folder currently looks like this - do I need to amend something here in order to cater for this new sprite?</p>

<pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" &gt;

        &lt;TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/hello" /&gt;

    &lt;/LinearLayout&gt;
</code></pre>

<p>Thanks</p>
