summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2019-06-04 23:25:58 +0200
committerBjørn Mork <bjorn@mork.no>2019-06-04 23:25:58 +0200
commit122248a5a270beca239be397e01cae3755588b46 (patch)
treeb4711ea990070313c0158d36775162a4b981c141
parent1754cf6f93a0fe057749c7dda6f94b5370462b56 (diff)
assorted wip debugging
Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rw-r--r--Defogger/res/layout/activity_configurenetwork.xml6
-rw-r--r--Defogger/res/layout/activity_ipcam.xml2
-rw-r--r--Defogger/res/values/strings.xml2
-rw-r--r--Defogger/src/no/mork/android/defogger/ConfigureNetworkActivity.java75
4 files changed, 74 insertions, 11 deletions
diff --git a/Defogger/res/layout/activity_configurenetwork.xml b/Defogger/res/layout/activity_configurenetwork.xml
index c94d760..15797b4 100644
--- a/Defogger/res/layout/activity_configurenetwork.xml
+++ b/Defogger/res/layout/activity_configurenetwork.xml
@@ -14,6 +14,12 @@
android:layout_height="wrap_content"
android:onClick="doFinish"
android:text="Finished"/>
+ <Button
+ android:id="@+id/cancel"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:onClick="doCancel"
+ android:text="Cancel"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/Defogger/res/layout/activity_ipcam.xml b/Defogger/res/layout/activity_ipcam.xml
index b53e206..d8a750e 100644
--- a/Defogger/res/layout/activity_ipcam.xml
+++ b/Defogger/res/layout/activity_ipcam.xml
@@ -71,7 +71,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="doCommand"
- android:text="@string/command"/>
+ android:text="@string/runcommand"/>
<EditText
android:id="@+id/command"
diff --git a/Defogger/res/values/strings.xml b/Defogger/res/values/strings.xml
index 0bcc7f2..e1468cb 100644
--- a/Defogger/res/values/strings.xml
+++ b/Defogger/res/values/strings.xml
@@ -19,6 +19,6 @@
<string name="lighttpd">Enable http API (volatile)</string>
<string name="rtsp">Enable rtsp (permanent)</string>
<string name="unsignedfw">Enable unsigned firmware (permanent)</string>
- <string name="command">Run command</string>
+ <string name="runcommand">Run command</string>
</resources>
diff --git a/Defogger/src/no/mork/android/defogger/ConfigureNetworkActivity.java b/Defogger/src/no/mork/android/defogger/ConfigureNetworkActivity.java
index 6892bd7..bf524c0 100644
--- a/Defogger/src/no/mork/android/defogger/ConfigureNetworkActivity.java
+++ b/Defogger/src/no/mork/android/defogger/ConfigureNetworkActivity.java
@@ -13,6 +13,7 @@ import android.os.Handler;
import android.os.ParcelUuid;
import android.util.Log;
import android.view.LayoutInflater;
+import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
@@ -78,6 +79,67 @@ public class ConfigureNetworkActivity extends Activity {
setResult(RESULT_CANCELED); // default
}
+ @Override
+ protected void onResume() {
+ Log.d(msg, "onResume()");
+ super.onResume();
+ }
+
+ @Override
+ protected void onPause() {
+ Log.d(msg, "onPause()");
+ super.onPause();
+ }
+
+ @Override
+ protected void onStop() {
+ Log.d(msg, "onStop()");
+ super.onStop();
+ }
+
+ @Override
+ protected void onDestroy() {
+ Log.d(msg, "onDestroy()");
+ super.onDestroy();
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle savedInstanceState) {
+ Log.d(msg, "onSaveInstanceState()");
+
+ // Save the user's current game state
+
+ // Always call the superclass so it can save the view hierarchy state
+ super.onSaveInstanceState(savedInstanceState);
+ }
+
+
+ public void onRestoreInstanceState(Bundle savedInstanceState) {
+ Log.d(msg, "onRestoreInstanceState()");
+ // Always call the superclass so it can restore the view hierarchy
+ super.onRestoreInstanceState(savedInstanceState);
+
+ // Restore state members from saved instance
+ }
+
+ public void onBackPressed() {
+ Log.d(msg, "onBackPressed()");
+ // returnConfigResult(null);
+ // setResult(RESULT_CANCELED); // default
+ super.onBackPressed();
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ Log.d(msg, "onOptionsItemSelected()");
+ switch (item.getItemId()){
+ case android.R.id.home:
+ onBackPressed();
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
public void returnConfigResult(String config) {
Log.d(msg, "returnConfigResult(): " + config);
Intent intent = new Intent();
@@ -88,6 +150,10 @@ public class ConfigureNetworkActivity extends Activity {
finish();
}
+ public void doCancel(View v) {
+ returnConfigResult(null);
+ }
+
public void doFinish(View v) {
// cfg = "M=" + net["M"] + ";I=" + essid + ";S=" + net["S"] + ";E=" + net["E"] + ";K=" + passwd
// L=I=Telenor_Guest,M=0,C=11,S=0,E=0,P=74
@@ -124,13 +190,4 @@ public class ConfigureNetworkActivity extends Activity {
returnConfigResult("M=0;I=" + ssid + ";S=" + S + ";E=" + E + ";K=" + password);
}
- private class NetAdapter extends ArrayAdapter {
- private int resource;
-
- public NetAdapter(Context context, int resource, String[] networks) {
- super(context, resource, networks);
- this.resource = resource;
- }
-
- }
}