# HG changeset patch # User Carl Byington # Date 1402438684 25200 # Node ID 75d86b7fd3f0f3eec8c70f5ef1e9b00b473a796c # Parent 2a8b52dbc104f8a0d30531a1aea6688452cd96b3 make hostlist and pubkeylist consistent diff -r 2a8b52dbc104 -r 75d86b7fd3f0 src/com/five_ten_sg/connectbot/HostListActivity.java --- a/src/com/five_ten_sg/connectbot/HostListActivity.java Tue Jun 10 13:33:06 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/HostListActivity.java Tue Jun 10 15:18:04 2014 -0700 @@ -97,11 +97,11 @@ public void onServiceConnected(ComponentName className, IBinder service) { bound = ((TerminalManager.TerminalBinder) service).getService(); // update our listview binder to find the service - HostListActivity.this.updateList(); + updateList(); } public void onServiceDisconnected(ComponentName className) { bound = null; - HostListActivity.this.updateList(); + updateList(); } }; @@ -146,7 +146,7 @@ } } else if (requestCode == REQUEST_EDIT) { - this.updateList(); + updateList(); } } @@ -174,21 +174,21 @@ boolean agreed = prefs.getBoolean(PreferenceConstants.EULA, false); if (!agreed) { - this.startActivityForResult(new Intent(this, WizardActivity.class), REQUEST_EULA); + startActivityForResult(new Intent(this, WizardActivity.class), REQUEST_EULA); } - this.makingShortcut = Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction()) + makingShortcut = Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction()) || Intent.ACTION_PICK.equals(getIntent().getAction()); // connect with hosts database and populate list - this.hostdb = new HostDatabase(this); - ListView list = this.getListView(); - this.sortedByColor = prefs.getBoolean(PreferenceConstants.SORT_BY_COLOR, false); - //this.list.setSelector(R.drawable.highlight_disabled_pressed); - list.setOnItemClickListener(new OnItemClickListener() { + hostdb = new HostDatabase(this); + updateList(); + sortedByColor = prefs.getBoolean(PreferenceConstants.SORT_BY_COLOR, false); + registerForContextMenu(getListView()); + getListView().setOnItemClickListener(new OnItemClickListener() { public synchronized void onItemClick(AdapterView parent, View view, int position, long id) { // launch off to console details - HostBean host = (HostBean) parent.getAdapter().getItem(position); + HostBean host = (HostBean) getListView().getItemAtPosition(position); Uri uri = host.getUri(); Intent contents = new Intent(Intent.ACTION_VIEW, uri); contents.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); @@ -205,11 +205,10 @@ } else { // otherwise just launch activity to show this host - HostListActivity.this.startActivity(contents); + startActivity(contents); } } }); - this.registerForContextMenu(list); quickconnect = (TextView) this.findViewById(R.id.front_quickconnect); quickconnect.setVisibility(makingShortcut ? View.GONE : View.VISIBLE); quickconnect.setOnKeyListener(new OnKeyListener() {