[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [orbot/master] get data from cursor
commit 0bdcab134c7091a1a5c2440f78cc2b4beb9f745f
Author: arrase <arrase@xxxxxxxxx>
Date: Mon Nov 28 22:25:59 2016 +0100
get data from cursor
---
.../main/java/org/torproject/android/OrbotMainActivity.java | 1 -
.../android/ui/hiddenservices/HiddenServicesActivity.java | 13 +++++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/app/src/main/java/org/torproject/android/OrbotMainActivity.java b/app/src/main/java/org/torproject/android/OrbotMainActivity.java
index aeb4a18..a4bb32e 100644
--- a/app/src/main/java/org/torproject/android/OrbotMainActivity.java
+++ b/app/src/main/java/org/torproject/android/OrbotMainActivity.java
@@ -618,7 +618,6 @@ public class OrbotMainActivity extends AppCompatActivity
Intent nResult = new Intent();
while (hostname == null) {
- //we need to stop and start Tor
try {
Thread.sleep(3000); //wait three seconds
} catch (Exception e) {
diff --git a/app/src/main/java/org/torproject/android/ui/hiddenservices/HiddenServicesActivity.java b/app/src/main/java/org/torproject/android/ui/hiddenservices/HiddenServicesActivity.java
index 9de0296..d752632 100644
--- a/app/src/main/java/org/torproject/android/ui/hiddenservices/HiddenServicesActivity.java
+++ b/app/src/main/java/org/torproject/android/ui/hiddenservices/HiddenServicesActivity.java
@@ -4,6 +4,7 @@ package org.torproject.android.ui.hiddenservices;
import android.content.ContentResolver;
import android.content.pm.PackageManager;
import android.database.ContentObserver;
+import android.database.Cursor;
import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.FloatingActionButton;
@@ -70,12 +71,16 @@ public class HiddenServicesActivity extends AppCompatActivity {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- TextView port = (TextView) view.findViewById(R.id.hs_port);
- TextView onion = (TextView) view.findViewById(R.id.hs_onion);
+ Cursor item = (Cursor) parent.getItemAtPosition(position);
Bundle arguments = new Bundle();
- arguments.putString("port", port.getText().toString());
- arguments.putString("onion", onion.getText().toString());
+ arguments.putString(
+ "port", item.getString(item.getColumnIndex(HSContentProvider.HiddenService.PORT))
+ );
+
+ arguments.putString(
+ "onion",item.getString(item.getColumnIndex(HSContentProvider.HiddenService.DOMAIN))
+ );
HSActionsDialog dialog = new HSActionsDialog();
dialog.setArguments(arguments);
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits