aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2008-08-27 04:32:07 +0000
committerKenny Root <kenny@the-b.org>2008-08-27 04:32:07 +0000
commit916ae1d563c4cbccaf8702c590d48a6138268775 (patch)
tree3cb47d710373a0cbb095ccaa48c77cbfb3262a27
parent3c9229fc48f6a4f083daf1f0d070769666848ed1 (diff)
downloadconnectbot-916ae1d563c4cbccaf8702c590d48a6138268775.tar.gz
connectbot-916ae1d563c4cbccaf8702c590d48a6138268775.tar.bz2
connectbot-916ae1d563c4cbccaf8702c590d48a6138268775.zip
* Fixed host PICK action
* Updated deletion to go directly to the ContentProvider
-rw-r--r--src/org/theb/ssh/HostsList.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/org/theb/ssh/HostsList.java b/src/org/theb/ssh/HostsList.java
index 34f9a7b..fc62baf 100644
--- a/src/org/theb/ssh/HostsList.java
+++ b/src/org/theb/ssh/HostsList.java
@@ -255,7 +255,7 @@ public class HostsList extends ListActivity {
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
- Uri url = ContentUris.withAppendedId(getIntent().getData(), getSelectedItemId());
+ Uri url = ContentUris.withAppendedId(getIntent().getData(), id);
String action = getIntent().getAction();
if (Intent.ACTION_PICK.equals(action)
@@ -263,18 +263,19 @@ public class HostsList extends ListActivity {
// The caller is waiting for us to return a note selected by
// the user. The have clicked on one, so return it now.
Intent intent = this.getIntent();
- intent.putExtra(Intent.EXTRA_TEXT, url.toString());
- setResult(RESULT_OK, intent);
- } else {
- // Launch activity to view/edit the currently selected item
- startActivity(new Intent(Intent.ACTION_PICK, url));
- }
- }
-
- private final void deleteItem() {
- mCursor.move(getSelectedItemPosition());
- mCursor.deleteRow();
+ intent.putExtra(Intent.EXTRA_TEXT, url.toString());
+ setResult(RESULT_OK, intent);
+ } else {
+ // Launch activity to view/edit the currently selected item
+ startActivity(new Intent(Intent.ACTION_PICK, url));
+ }
}
+
+ private final void deleteItem() {
+ mCursor.move(getSelectedItemPosition());
+ Uri uri = ContentUris.withAppendedId(getIntent().getData(), getSelectedItemId());
+ getContentResolver().delete(uri, null, null);
+ }
private final void insertItem() {
// Launch activity to insert a new item