From 747e11c6ff28fc833855b9979ce68a15b99915f6 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Mon, 7 Sep 2015 21:06:48 -0700 Subject: Update pubkey list in onStart instead of onCreate --- app/src/main/java/org/connectbot/PubkeyListActivity.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/org/connectbot/PubkeyListActivity.java b/app/src/main/java/org/connectbot/PubkeyListActivity.java index 5480cb2..a2cc170 100644 --- a/app/src/main/java/org/connectbot/PubkeyListActivity.java +++ b/app/src/main/java/org/connectbot/PubkeyListActivity.java @@ -120,8 +120,8 @@ public class PubkeyListActivity extends ListActivity implements EventListener { bindService(new Intent(this, TerminalManager.class), connection, Context.BIND_AUTO_CREATE); - if (pubkeydb == null) - pubkeydb = PubkeyDatabase.get(this); + pubkeydb = PubkeyDatabase.get(this); + updateList(); } @Override @@ -142,11 +142,6 @@ public class PubkeyListActivity extends ListActivity implements EventListener { getResources().getText(R.string.app_name), getResources().getText(R.string.title_pubkey_list))); - // connect with hosts database and populate list - pubkeydb = PubkeyDatabase.get(this); - - updateList(); - registerForContextMenu(getListView()); getListView().setOnItemClickListener(new OnItemClickListener() { @@ -542,8 +537,7 @@ public class PubkeyListActivity extends ListActivity implements EventListener { } // write new value into database - if (pubkeydb == null) - pubkeydb = PubkeyDatabase.get(this); + pubkeydb = PubkeyDatabase.get(this); pubkeydb.savePubkey(pubkey); updateList(); -- cgit v1.2.3