0
Androidmanifest:
<activity android:name=".pictureManagement.boundary.DocsIDUI"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"
android:launchMode="singleTask">
</activity>
<activity android:name=".pictureManagement.boundary.PicturePreview"
android:screenOrientation="portrait"
android:launchMode="singleTask">
</activity>
Activity Docsidui:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {
if (photoFile != null) {
imageUri = Uri.fromFile(photoFile);
Intent intent = new Intent(DocsIDUI.this, PicturePreview.class);
Bundle bundle = new Bundle();
bundle.putSerializable(PicturePreview.NAME, name);
if (!isBackStep)
{
bundle.putSerializable(PicturePreview.STEP, 0);
} else
{
bundle.putSerializable(PicturePreview.STEP, 1);
}
bundle.putSerializable(PicturePreview.URI_PHOTO, imageUri.toString());
intent.putExtras(bundle);
DocsIDUI.this.startActivity(intent);
}
}
}
Activity Picturepreview:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_picture_preview);
getNewIntent(getIntent());
getImage();
getComponents();
setListeners();
}
@Override
protected void onResume(){
super.onResume();
getNewIntent(getIntent());
}
private void getNewIntent(Intent intent) {
if (intent != null && intent.hasExtra(URI_PHOTO)) {
this.stringUri = (String) intent.getSerializableExtra(URI_PHOTO);
imageUri = Uri.parse(stringUri);
}
if (intent != null && intent.hasExtra(NAME)) {
this.name = (String) intent.getSerializableExtra(NAME);
}
if (intent != null && intent.hasExtra(STEP)) {
this.step = (int) intent.getSerializableExtra(STEP);
}
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
When you first open Activity Picturepreview (Docsidui -> Picturepreview), it normally opens, but when you return and open Picturepreview a second time, when isBackStack is positive, it does not open by going straight through