get data from cursor

This commit is contained in:
arrase 2016-11-28 22:25:59 +01:00
parent 7a9ad4720b
commit 0bdcab134c
2 changed files with 9 additions and 5 deletions

View File

@ -618,7 +618,6 @@ public class OrbotMainActivity extends AppCompatActivity
Intent nResult = new Intent(); Intent nResult = new Intent();
while (hostname == null) { while (hostname == null) {
//we need to stop and start Tor
try { try {
Thread.sleep(3000); //wait three seconds Thread.sleep(3000); //wait three seconds
} catch (Exception e) { } catch (Exception e) {

View File

@ -4,6 +4,7 @@ package org.torproject.android.ui.hiddenservices;
import android.content.ContentResolver; import android.content.ContentResolver;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.database.ContentObserver; import android.database.ContentObserver;
import android.database.Cursor;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.design.widget.FloatingActionButton; import android.support.design.widget.FloatingActionButton;
@ -70,12 +71,16 @@ public class HiddenServicesActivity extends AppCompatActivity {
@Override @Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
TextView port = (TextView) view.findViewById(R.id.hs_port); Cursor item = (Cursor) parent.getItemAtPosition(position);
TextView onion = (TextView) view.findViewById(R.id.hs_onion);
Bundle arguments = new Bundle(); Bundle arguments = new Bundle();
arguments.putString("port", port.getText().toString()); arguments.putString(
arguments.putString("onion", onion.getText().toString()); "port", item.getString(item.getColumnIndex(HSContentProvider.HiddenService.PORT))
);
arguments.putString(
"onion",item.getString(item.getColumnIndex(HSContentProvider.HiddenService.DOMAIN))
);
HSActionsDialog dialog = new HSActionsDialog(); HSActionsDialog dialog = new HSActionsDialog();
dialog.setArguments(arguments); dialog.setArguments(arguments);