|
|
@@ -91,7 +91,6 @@ public class UpdateActivity extends AppCompatActivity implements UpdateAdapter.U
|
|
|
private UpdatePhotoModel mPhotoModel;
|
|
|
|
|
|
private File photoFile = null;
|
|
|
- public String LastFileName = "";
|
|
|
|
|
|
private ProgressDialog mProgressDialog;
|
|
|
|
|
|
@@ -186,7 +185,7 @@ public class UpdateActivity extends AppCompatActivity implements UpdateAdapter.U
|
|
|
// photoFile = scaleFile;
|
|
|
// }
|
|
|
|
|
|
- ImageUtil.updateGallery(mCtx,photoFile.toString());
|
|
|
+ ImageUtil.updateGallery(mCtx,photoFile.getAbsolutePath());
|
|
|
if (mPhotoModel != null) {
|
|
|
mPhotoModel.setPhotoPath(photoFile.getAbsolutePath());
|
|
|
}
|
|
|
@@ -398,6 +397,7 @@ public class UpdateActivity extends AppCompatActivity implements UpdateAdapter.U
|
|
|
|
|
|
private void goHome() {
|
|
|
Intent intent = new Intent(self, MainActivity.class);
|
|
|
+ intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
self.startActivity(intent);
|
|
|
|
|
|
sendBroadcast(new Intent(HomeFragment.HomeReloadBroadcastAction));
|
|
|
@@ -540,8 +540,8 @@ public class UpdateActivity extends AppCompatActivity implements UpdateAdapter.U
|
|
|
private File createImageFile() throws IOException
|
|
|
{
|
|
|
// Create an image file name
|
|
|
-// String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmSS").format(new Date());
|
|
|
-// String imageFileName = "JPEG_" + timeStamp + "_";
|
|
|
+ String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmSS").format(new Date());
|
|
|
+ String imageFileName = "JPEG_" + timeStamp + "_";
|
|
|
File storageDir = new File(Environment.getExternalStorageDirectory().getPath() + "/Apex Driver/photo/temp/");
|
|
|
|
|
|
File dir1 = new File(Environment.getExternalStorageDirectory().getPath() + "/Apex Driver");
|
|
|
@@ -562,10 +562,9 @@ public class UpdateActivity extends AppCompatActivity implements UpdateAdapter.U
|
|
|
boolean b = dir3.mkdir();
|
|
|
}
|
|
|
|
|
|
- LastFileName = storageDir + mPhotoModel.getPhotoName();
|
|
|
|
|
|
- File image = File.createTempFile(mPhotoModel.getPhotoName(), /* prefix */
|
|
|
- "", /* suffix */
|
|
|
+ File image = File.createTempFile(imageFileName, /* prefix */
|
|
|
+ ".jpg", /* suffix */
|
|
|
storageDir /* directory */
|
|
|
);
|
|
|
|