diff --git a/app/src/main/java/me/datenknoten/tueroeffner/MainActivity.java b/app/src/main/java/me/datenknoten/tueroeffner/MainActivity.java index e1b82e2..b931bc5 100644 --- a/app/src/main/java/me/datenknoten/tueroeffner/MainActivity.java +++ b/app/src/main/java/me/datenknoten/tueroeffner/MainActivity.java @@ -216,4 +216,13 @@ public class MainActivity extends ActionBarActivity { Toast.makeText(v.getContext(), "Konnte Befehl „Tür öffnen“ nicht ausführen.", Toast.LENGTH_SHORT).show(); } } + + public void buttonLockInnerDoor(View v) { + try { + new CommandExecuter(getDoorKey()).doInBackground("indoor_lock"); + Toast.makeText(v.getContext(), getString(R.string.door_open), Toast.LENGTH_SHORT).show(); + } catch (Exception e) { + Toast.makeText(v.getContext(), "Konnte Befehl „Tür schließen“ nicht ausführen.", Toast.LENGTH_SHORT).show(); + } + } } diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml index 5fce1ab..a8ad2a0 100644 --- a/app/src/main/res/layout/fragment_main.xml +++ b/app/src/main/res/layout/fragment_main.xml @@ -64,6 +64,14 @@ android:text="@string/button_inner_door_open" android:enabled="false" android:onClick="buttonUnlockInnerDoor" /> + +