Browse Source

Setup method for onClick action of Send button

master
jimi 13 years ago
parent
commit
0f0cfd6913
  1. 3
      res/layout/main.xml
  2. 5
      src/com/jinfield/sampleapp/MainActivity.java

3
res/layout/main.xml

@ -12,6 +12,7 @@
<Button <Button
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/button_send" />
android:text="@string/button_send"
android:onClick="sendMessage" />
</LinearLayout> </LinearLayout>

5
src/com/jinfield/sampleapp/MainActivity.java

@ -2,6 +2,7 @@ package com.jinfield.sampleapp;
import android.app.Activity; import android.app.Activity;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
public class MainActivity extends Activity public class MainActivity extends Activity
{ {
@ -12,4 +13,8 @@ public class MainActivity extends Activity
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.main); setContentView(R.layout.main);
} }
/** Called whe user clicks the send Button */
public void sendMessage(View view) {
// TODO
}
} }