Ask what to do when leaving unsent draft

Fixes #118
This commit is contained in:
M66B
2018-09-20 16:25:09 +00:00
parent 123c72f870
commit 11617bc585
2 changed files with 31 additions and 13 deletions

View File

@@ -23,13 +23,11 @@ import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.MenuItem;
import java.util.ArrayList;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
public class ActivityCompose extends ActivityBilling implements FragmentManager.OnBackStackChangedListener {
static final int REQUEST_CONTACT_TO = 1;
@@ -98,17 +96,6 @@ public class ActivityCompose extends ActivityBilling implements FragmentManager.
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getSupportFragmentManager().popBackStack();
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onBackStackChanged() {
if (getSupportFragmentManager().getBackStackEntryCount() == 0)