refactor
This commit is contained in:
parent
0fd59bc78d
commit
e8a5099518
|
@ -32,19 +32,6 @@ public class HiddenServicesActivity extends AppCompatActivity {
|
|||
HSContentProvider.HiddenService.PORT,
|
||||
HSContentProvider.HiddenService.DOMAIN};
|
||||
|
||||
class HSObserver extends ContentObserver {
|
||||
HSObserver(Handler handler) {
|
||||
super(handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChange(boolean selfChange) {
|
||||
mAdapter.changeCursor(mCR.query(
|
||||
HSContentProvider.CONTENT_URI, mProjection, null, null, null
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -106,4 +93,17 @@ public class HiddenServicesActivity extends AppCompatActivity {
|
|||
private boolean hasPermission() {
|
||||
return (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED);
|
||||
}
|
||||
|
||||
class HSObserver extends ContentObserver {
|
||||
HSObserver(Handler handler) {
|
||||
super(handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChange(boolean selfChange) {
|
||||
mAdapter.changeCursor(mCR.query(
|
||||
HSContentProvider.CONTENT_URI, mProjection, null, null, null
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,8 +42,8 @@ public class HSDataDialog extends DialogFragment {
|
|||
((EditText) dialog_view.findViewById(R.id.hsOnionPort)).getText().toString()
|
||||
);
|
||||
|
||||
if (checkInput(localPort,onionPort)) {
|
||||
saveData(serverName, localPort,onionPort);
|
||||
if (checkInput(localPort, onionPort)) {
|
||||
saveData(serverName, localPort, onionPort);
|
||||
serviceDataDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public class HSDataDialog extends DialogFragment {
|
|||
return serviceDataDialog;
|
||||
}
|
||||
|
||||
private boolean checkInput(Integer local, Integer remote){
|
||||
private boolean checkInput(Integer local, Integer remote) {
|
||||
boolean is_ok = true;
|
||||
Integer error_msg = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue