[Android Q&A, Help & Troubleshooting] AmatuerAppDeveloper:
Can somebody please tell me how these bits of code

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {

Uri originalUri = data.getData();
selectedImageImageView.setImageURI(originalUri);
selectedImageImageView.setVisibility(View.VISIBLE);
progressDialog.setProgress(0);
progressDialog.show();

new GetImageFileTask(this).execute(imageHelper,
selectedImageImageView);

}
super.onActivityResult(requestCode, resultCode, data);
}

public static final int GALLERY_KITKAT_INTENT_CALLED = 2;
public static final int GALLERY_INTENT_CALLED = 1;
private final int PREF_WIDTH_IMAGE = 500;
private Activity activity;

public ImageHelper(Activity activity) {
this.activity = activity;
}

public void getImage() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
activity.startActivityForResult(intent, GALLERY_INTENT_CALLED);
} else {
showKitKatGallery();
}
}

private void showKitKatGallery() {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");
activity.startActivityForResult(intent, GALLERY_KITKAT_INTENT_CALLED);
}

public File getFileFromImageView(ImageView imageView) throws IOException {
int preferredWidth = PREF_WIDTH_IMAGE;
Bitmap origBitmap = drawableToBitmap(imageView.getDrawable());
int origWidth = origBitmap.getWidth();
int origHeight = origBitmap.getHeight();

int destHeight, destWidth;

if (origWidth <= preferredWidth || origHeight <= preferredWidth) {
destWidth = origWidth;
destHeight = origHeight;
} else {
destWidth = PREF_WIDTH_IMAGE;
destHeight = origHeight / (origWidth / destWidth);
}

File tempFile = new File(activity.getCacheDir(), "temp.png");
tempFile.createNewFile();

Bitmap bitmap = resizeBitmap(origBitmap, destWidth, destHeight);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 0, bos);
byte[] bitmapData = bos.toByteArray();

FileOutputStream fos = new FileOutputStream(tempFile);
fos.write(bitmapData);
fos.close();

return tempFile;
}

public static Bitmap drawableToBitmap(Drawable drawable) {
if (drawable == null) {
return null;
}

if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
}

int width = drawable.getIntrinsicWidth();
width = width > 0 ? width : 1;
int height = drawable.getIntrinsicHeight();
height = height > 0 ? height : 1;

Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);

return bitmap;
}

private Bitmap resizeBitmap(Bitmap inputBitmap, int newWidth, int newHeight) {
return Bitmap.createScaledBitmap(inputBitmap, newWidth, newHeight, true);
}
}

have managed to come up with this error:

05-15 02:10:01.199: E/AndroidRuntime(17169): FATAL EXCEPTION: main
05-15 02:10:01.199: E/AndroidRuntime(17169): Process: com.simplistic.bloxbackup, PID: 17169
05-15 02:10:01.199: E/AndroidRuntime(17169): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/image:13985 flg=0x43 }} to activity {com.simplistic.bloxbackup/com.simplistic.bloxbackup.activities.GalleryActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setImageURI(android.net.Uri)' on a null object reference
05-15 02:10:01.199: E/AndroidRuntime(17169):	at android.app.ActivityThread.deliverResults(ActivityThread.java:3637)
05-15 02:10:01.199: E/AndroidRuntime(17169):	at android.app.ActivityThread.handleSendResult(ActivityThread.java:3680)
05-15 02:10:01.199: E/AndroidRuntime(17169):	at android.app.ActivityThread.access$1300(ActivityThread.java:149)
05-15 02:10:01.199: E/AndroidRuntime(17169):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
05-15 02:10:01.199: E/AndroidRuntime(17169):	at android.os.Handler.dispatchMessage(Handler.java:102)
05-15 02:10:01.199: E/AndroidRuntime(17169):	at android.os.Looper.loop(Looper.java:211)
05-15 02:10:01.199: E/AndroidRuntime(17169):	at android.app.ActivityThread.main(ActivityThread.java:5321)
05-15 02:10:01.199: E/AndroidRuntime(17169):	at java.lang.reflect.Method.invoke(Native Method)
05-15 02:10:01.199: E/AndroidRuntime(17169):	at java.lang.reflect.Method.invoke(Method.java:372)
05-15 02:10:01.199: E/AndroidRuntime(17169):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)
05-15 02:10:01.199: E/AndroidRuntime(17169):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
05-15 02:10:01.199: E/AndroidRuntime(17169): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setImageURI(android.net.Uri)' on a null object reference
05-15 02:10:01.199: E/AndroidRuntime(17169):	at com.simplistic.bloxbackup.activities.GalleryActivity.onActivityResult(GalleryActivity.java:101)
05-15 02:10:01.199: E/AndroidRuntime(17169):	at android.app.Activity.dispatchActivityResult(Activity.java:6135)
05-15 02:10:01.199: E/AndroidRuntime(17169):	at android.app.ActivityThread.deliverResults(ActivityThread.java:3633)

Because i don't know if any of you have seen my thread about my new app "Blox Backup" but the launch has been a big massive flop due this problem.

Now what i don't get is that it was all working as it should before i signed then published it?! I mean i know that apps don't work on every phone but this simply will not work at all no matter the phone!

So can someone please review the code and see where the null pointer is coming from because it shouldn't be coming up as null especially when it didn't before. I have tried to get an answer on Stack but nobody has bothered

So yeah please give me hand because i need this app back on Gplay

Thanks