What is causing the NullPointerException in this line?
<p>The debugger says factory is null. What should I do? The factory is set to a plain .png of a black square.</p>

<p>package com.animation.learning;</p>

<pre><code>import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.view.View;

public class MyBringBack extends View {

    Bitmap gBall;

    public MyBringBack(Context context) {
        super(context);

        gBall = BitmapFactory.decodeResource(getResources(), R.drawable.square);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        canvas.drawColor(Color.WHITE);
        canvas.drawBitmap(gBall, (canvas.getWidth() / 2), 0, null);

    }


}
</code></pre>
