My PanelActivity contains a recyclerView with a list of items. Each item has a click event. This click will open DetailsActivity .
DetailsActivity has a floatActionButton that opens a full-screen dialog (my DetailDialogFragment extends DialogFragment ).
DetailDialogFragment has an Up / Home button with firing.
Problem: if the user clicks the "Up" button, the dialog is rejected, and DetailsActivity disappears, and the application returns to PanelActivity .
Possible reason. Below the Up button of the dialog box is the Up button in the DetailsActivity . Is it possible to fire two click events when the dialog is completed and both have the Up button in the same place?
Edit: show code.
Open DetailsActivity from PanelActivity (by clicking one item in recyclerView).
Intent intent = new Intent(context, DetailsActivity.class); intent.putExtra("headerCode", headerCode.getText()); context.startActivity(intent);
The Up button in the Details section.
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { // Respond to the action bar Up/Home button case android.R.id.home: NavUtils.navigateUpFromSameTask(this); return true; } return super.onOptionsItemSelected(item); }
Open the full-screen dialog in the DetailsActivity section.
private void showCreateDetailDialog() { FragmentManager fragmentManager = getSupportFragmentManager(); DetailDialogFragment newFragment = new DetailDialogFragment();
And finally, the Up button in DetailDialogFragment.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.save) { validateForm(); return true; } else if (id == android.R.id.home) {
android android-dialogfragment up-button
JCarlos Oct 31 '16 at 21:42 2016-10-31 21:42
source share