summaryrefslogtreecommitdiff
path: root/app/java/src/MainActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/java/src/MainActivity.java')
-rw-r--r--app/java/src/MainActivity.java32
1 files changed, 29 insertions, 3 deletions
diff --git a/app/java/src/MainActivity.java b/app/java/src/MainActivity.java
index 049ee29..bfad05a 100644
--- a/app/java/src/MainActivity.java
+++ b/app/java/src/MainActivity.java
@@ -14,11 +14,15 @@ import android.os.Bundle;
import android.util.Log;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
import android.view.TextureView;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
+import android.provider.Settings;
public class MainActivity extends Activity {
@@ -44,6 +48,9 @@ public class MainActivity extends Activity {
this.buttonStart = (Button) findViewById(R.id.button_start);
this.dnsProxyService = new Intent(this, DNSProxyService.class);
+
+ // if setting.get(USER_WIFI_LISTENER)
+ // startService(new Intent(this, WifiListenerService.class));
}
@Override
@@ -61,6 +68,28 @@ public class MainActivity extends Activity {
unregisterReceiver(receiver);
}
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater menuInflater = getMenuInflater();
+ menuInflater.inflate(R.menu.settings, menu);
+
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ int itemId = item.getItemId();
+
+ if (itemId == R.id.menu__settings) {
+ Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
+ startActivity(intent);
+
+ return true;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+
/**
* is called by "startActivityForResult" internally
*/
@@ -71,9 +100,6 @@ public class MainActivity extends Activity {
}
}
- @Override
- public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {}
-
/**
* button_start is clicked
*/