diff options
Diffstat (limited to 'app/java/src/MainActivity.java')
-rw-r--r-- | app/java/src/MainActivity.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/app/java/src/MainActivity.java b/app/java/src/MainActivity.java index f437c9d..049ee29 100644 --- a/app/java/src/MainActivity.java +++ b/app/java/src/MainActivity.java @@ -12,6 +12,8 @@ import android.net.VpnService; import android.os.Bundle; +import android.util.Log; + import android.view.TextureView; import android.view.View; @@ -30,10 +32,7 @@ public class MainActivity extends Activity { */ @Override public void onReceive(Context context, Intent intent) { - Bundle bundle = intent.getExtras(); - // if (bundle != null) { - setStateButtonStart(); - // } + setStateButtonStart(); } }; @@ -80,7 +79,7 @@ public class MainActivity extends Activity { */ public void onClickButtonStart(View view) { if (!DNSProxyService.isRunning()) { //start - Intent intent = DNSProxyService.prepare(this); + Intent intent = VpnService.prepare(this); if (intent != null) { startActivityForResult(intent, 0); @@ -108,7 +107,7 @@ public class MainActivity extends Activity { * Start DNSProxyService */ public void start() { - startService(this.dnsProxyService); + startService(this.dnsProxyService.setAction(DNSProxyService.ACTION_START)); Toast .makeText( @@ -123,7 +122,7 @@ public class MainActivity extends Activity { * Stop DNSProxyService */ public void stop() { - stopService(this.dnsProxyService); + startService(this.dnsProxyService.setAction(DNSProxyService.ACTION_STOP)); Toast .makeText( |