Permalink
Browse files

Rig it with a uber bare bones NoteEditActivity.

  • Loading branch information...
1 parent 8421c88 commit b743f5180267c76207a655cd017878daba029351 @Spidey01 committed Aug 4, 2012
@@ -12,12 +12,32 @@
android:label="@string/app_name"
android:name="com.spidey01.metter.android.App"
>
+ <!-- Activity for listing/picking notes -->
<activity
android:name=".NoteListActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+ <action android:name="android.intent.action.EDIT" />
+ <action android:name="android.intent.action.PICK" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.GET_CONTENT" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
+ <activity
+ android:label="@string/app_name"
+ android:name=".NoteEditActivity"
+ >
+ <intent-filter>
+ <action android:name="android.intent.action.EDIT" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
</activity>
</application>
</manifest>
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
-<TextView
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+ <TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello World, Metter"
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="" />
+</LinearLayout>
@@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ >
+ <ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
- >
- <ListView android:id="@android:id/list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:drawSelectorOnTop="false"/>
- <TextView android:id="@android:id/empty"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:text="You appear to have no Notes."/>
+ android:layout_weight="1"/>
+ <TextView android:id="@android:id/empty"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="You appear to have no Notes."/>
</LinearLayout>
@@ -0,0 +1,51 @@
+package com.spidey01.metter.android;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+public class NoteEditActivity extends Activity {
+
+ /** The activity is being created.
+ */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setContentView(R.layout.note_edit);
+ }
+
+ /* The activity is about to become visible.
+ */
+ @Override
+ protected void onStart() {
+ super.onStart();
+ }
+
+ /* The activity has become visible (it is now "resumed").
+ */
+ @Override
+ protected void onResume() {
+ super.onResume();
+ }
+
+ /* Another activity is taking focus (this activity is about to be "paused").
+ */
+ @Override
+ protected void onPause() {
+ super.onPause();
+ }
+
+ /* The activity is no longer visible (it is now "stopped")
+ */
+ @Override
+ protected void onStop() {
+ super.onStop();
+ }
+
+ /* The activity is about to be destroyed.
+ */
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ }
+}
@@ -1,7 +1,10 @@
package com.spidey01.metter.android;
import android.app.ListActivity;
+import android.content.Intent;
import android.os.Bundle;
+import android.view.View;
+import android.widget.ListView;
public class NoteListActivity extends ListActivity {
@@ -19,6 +22,7 @@ public void onCreate(Bundle savedInstanceState) {
@Override
protected void onStart() {
super.onStart();
+
}
/* The activity has become visible (it is now "resumed").
@@ -48,4 +52,18 @@ protected void onStop() {
protected void onDestroy() {
super.onDestroy();
}
+
+ /* This method will be called when an item in the list is selected.
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onListItemClick(ListView l, View v, int position, long id) {
+ super.onListItemClick(l, v, position, id);
+
+ Intent n = new Intent(
+ NoteListActivity.this,
+ NoteEditActivity.class);
+ startActivity(n);
+ }
}

0 comments on commit b743f51

Please sign in to comment.