diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 945841d..f4ed822 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -24,6 +24,11 @@ + diff --git a/res/layout/activity_monitor.xml b/res/layout/activity_monitor.xml new file mode 100644 index 0000000..a45350e --- /dev/null +++ b/res/layout/activity_monitor.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/protect/babymonitor/MonitorActivity.java b/src/protect/babymonitor/MonitorActivity.java new file mode 100644 index 0000000..d58ea65 --- /dev/null +++ b/src/protect/babymonitor/MonitorActivity.java @@ -0,0 +1,65 @@ +/** + * This file is part of the Protect Baby Monitor. + * + * Protect Baby Monitor is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Protect Baby Monitor is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Protect Baby Monitor. If not, see . + */ +package protect.babymonitor; + +import android.app.Activity; +import android.os.Bundle; +import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; + +public class MonitorActivity extends Activity +{ + final String TAG = "BabyMonitor"; + + @Override + protected void onCreate(Bundle savedInstanceState) + { + Log.i(TAG, "Baby monitor start"); + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_monitor); + } + + @Override + protected void onDestroy() + { + Log.i(TAG, "Baby monitor stop"); + + super.onDestroy(); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) + { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.start, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) + { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + if (id == R.id.action_settings) { + return true; + } + return super.onOptionsItemSelected(item); + } +} diff --git a/src/protect/babymonitor/StartActivity.java b/src/protect/babymonitor/StartActivity.java index 2592572..209750b 100644 --- a/src/protect/babymonitor/StartActivity.java +++ b/src/protect/babymonitor/StartActivity.java @@ -34,5 +34,18 @@ public class StartActivity extends Activity super.onCreate(savedInstanceState); setContentView(R.layout.activity_start); + + final Button monitorButton = (Button) findViewById(R.id.startMonitorButton); + monitorButton.setOnClickListener(new View.OnClickListener() + { + @Override + public void onClick(View v) + { + Log.i(TAG, "Starting up monitor"); + + Intent i = new Intent(getApplicationContext(), MonitorActivity.class); + startActivity(i); + } + }); } }