Here is the error:
20:19:00.671 1437 ERROR ReceiptWallet Cannot load image
20:19:00.671 1437 ERROR ReceiptWallet java.lang.NullPointerException
20:19:00.671 1437 ERROR ReceiptWallet at org.xil3.receiptwallet.Receipt.onActivityResult(Receipt.java:102)
20:19:00.671 1437 ERROR ReceiptWallet at android.app.Activity.dispatchActivityResult(Activity.java:3828)
20:19:00.671 1437 ERROR ReceiptWallet at android.app.ActivityThread.deliverResults(ActivityThread.java:3325)
20:19:00.671 1437 ERROR ReceiptWallet at android.app.ActivityThread.handleSendResult(ActivityThread.java:3371)
20:19:00.671 1437 ERROR ReceiptWallet at android.app.ActivityThread.access$2700(ActivityThread.java:119)
20:19:00.671 1437 ERROR ReceiptWallet at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1893)
20:19:00.671 1437 ERROR ReceiptWallet at android.os.Handler.dispatchMessage(Handler.java:99)
20:19:00.671 1437 ERROR ReceiptWallet at android.os.Looper.loop(Looper.java:123)
20:19:00.671 1437 ERROR ReceiptWallet at android.app.ActivityThread.main(ActivityThread.java:4363)
20:19:00.671 1437 ERROR ReceiptWallet at java.lang.reflect.Method.invokeNative(Native Method)
20:19:00.671 1437 ERROR ReceiptWallet at java.lang.reflect.Method.invoke(Method.java:521)
20:19:00.671 1437 ERROR ReceiptWallet at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
20:19:00.671 1437 ERROR ReceiptWallet at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
20:19:00.671 1437 ERROR ReceiptWallet at dalvik.system.NativeStart.main(Native Method)
Here is my code:
Using java Syntax Highlighting
- private void saveFullPicture() {
- Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
- File file = new File(Environment.getExternalStorageDirectory(), String.valueOf(System.currentTimeMillis()) + ".jpg");
- outputFileUri = Uri.fromFile(file);
- intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
- startActivityForResult(intent, TAKE_PICTURE);
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
Using java Syntax Highlighting
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- Log.v( "ReceiptWallet", "resultCode: " + resultCode );
- switch( resultCode ) {
- case 0:
- Log.v("ReceiptWallet", "User cancelled");
- break;
- case -1:
- try {
- BitmapFactory.Options options = new BitmapFactory.Options();
- options.inSampleSize = 4;
- Bitmap bitmap = BitmapFactory.decodeFile(outputFileUri.getPath(), options);
- mIv.setImageBitmap(bitmap);
- } catch(Exception e) {
- Log.e("ReceiptWallet", "Cannot load image", e);
- }
- break;
- }
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4

