From 7f0436aa2a782d926a81bd5bdf76baf0253582da Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 12 May 2023 13:12:57 +0200 Subject: working commit --- app/java/src/MainActivity.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'app/java/src/MainActivity.java') 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( -- cgit v1.2.3