This commit is contained in:
str4d
2014-12-23 21:57:58 +00:00
parent 12794da831
commit adbfcd956c
3 changed files with 20 additions and 0 deletions

View File

@@ -27,6 +27,13 @@ public class ViewContactActivity extends ActionBarActivity {
Bundle args = getIntent().getExtras();
if (args != null)
destination = args.getString(ViewContactFragment.ADDRESS);
if (destination == null) {
setResult(RESULT_CANCELED);
finish();
return;
}
ViewContactFragment f = ViewContactFragment.newInstance(destination);
getSupportFragmentManager().beginTransaction()
.add(android.R.id.content, f).commit();

View File

@@ -27,6 +27,13 @@ public class ViewIdentityActivity extends ActionBarActivity {
Bundle args = getIntent().getExtras();
if (args != null)
key = args.getString(ViewIdentityFragment.ADDRESS);
if (key == null) {
setResult(RESULT_CANCELED);
finish();
return;
}
ViewIdentityFragment f = ViewIdentityFragment.newInstance(key);
getSupportFragmentManager().beginTransaction()
.add(android.R.id.content, f).commit();

View File

@@ -1,5 +1,6 @@
package i2p.bote.android.util;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
@@ -111,6 +112,11 @@ public abstract class ViewAddressFragment extends Fragment {
if (mAddress != null) {
loadAddress();
} else {
// No address provided, finish
// Should not happen
getActivity().setResult(Activity.RESULT_CANCELED);
getActivity().finish();
}
}