I'm trying to get a bitmap drawn from a view, as I want to blur that bitmap and use it as a background for a following activity. Logcat gives me:
NullPointerException at android.graphics.Bitmap.createBitmap(Bitmap.java:484)
My code:
 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Get the view from activity_main.xml
    setContentView(R.layout.activity_splash_page);
    ProgressWheel wheel = (ProgressWheel) findViewById(R.id.progress_wheel);
    wheel.setClickable(false);
    TextView touch = (TextView) findViewById(R.id.touch_splash);
    touch.setClickable(false);
    TextView level = (TextView) findViewById(R.id.level_splash);
    level.setClickable(false);
    wheel.setProgress(0.7f);
    wheel.setClickable(true);
    touch.setClickable(true);
    level.setClickable(true);
    RelativeLayout view = (RelativeLayout)findViewById(R.id.viewtocapture);
    ImageView bmImage = (ImageView)findViewById(R.id.imageView);
    view.setDrawingCacheEnabled(true);
    // this is the important code :)
    // Without it the view will have a dimension of 0,0 and the bitmap will be null
    view.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
            View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
    view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
    view.buildDrawingCache(true);
    view.buildDrawingCache();
    Bitmap b = Bitmap.createBitmap(view.getDrawingCache());      //Line 53
    view.setDrawingCacheEnabled(false); // clear drawing cache
    bmImage.setImageBitmap(b);
    wheel.setProgress(0.0f);
}
Here's the Stacktrace/Logcat:
Caused by: java.lang.NullPointerException
        at android.graphics.Bitmap.createBitmap(Bitmap.java:484)
        at com.redstonedevelopers.status_v1.SplashPage.onCreate(SplashPage.java:53)
        at android.app.Activity.performCreate(Activity.java:5047)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2056)       
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2117)
        at android.app.ActivityThread.access$700(ActivityThread.java:134)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1218)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4867)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
        at dalvik.system.NativeStart.main(Native Method)
I've tried answers from: Here: take a screenshot from the activity Here: NullPointerException in createBitmap() from View and Here: android createBitmap NullPointerException
All to no avail. What should I change and/or do to get this working?
-R