Ensure that I2P system vars are set in any Activity that uses I2PBote

Sometimes the Android runtime kills off the Bote process to save memory, and
recreates it when the user next opens it. If the user was on an Activity that
was not EmailListActivity, then when recreated the I2P system vars would not be
set, and the first call to I2PBote.getInstance() would create an instance with
invalid paths. This was non-fatal - killing Bote and restarting it would fix
the problem - but was bad UX, because from the user's PoV all their emails and
data had disappeared.
This commit is contained in:
str4d
2014-07-02 03:01:28 +00:00
parent 8ed6bbd0fe
commit 085778c98f
10 changed files with 47 additions and 3 deletions

View File

@@ -39,6 +39,10 @@ public class ViewEmailActivity extends ActionBarActivity implements
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_email);
// Initialize I2P settings
InitActivities init = new InitActivities(this);
init.initialize();
// Enable ActionBar app icon to behave as action to go back
getSupportActionBar().setDisplayHomeAsUpEnabled(true);