Hi,

i have wraped ArrayAdapter of a a single editText in a ListView
(notepad example)


ListView MsgListView = (ListView)findViewById(R.id.MsgListView);
Button addimage = (Button) findViewById(R.id.addimage);
final EditText EditMsgText = (EditText)findViewById(R.id.EditMsgText);
final ArrayList<String> todoItems = new ArrayList<String>();
final ArrayAdapter<String> aa;

        aa = new ArrayAdapter<String>(this,
        android.R.layout.simple_list_item_1,
        todoItems);
        MsgListView.setAdapter(aa);



EditMsgText.setOnKeyListener(new OnKeyListener() {
                public boolean onKey(View v, int keyCode, KeyEvent event) {
                if (event.getAction() == KeyEvent.ACTION_DOWN)
                if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER)
                {
                todoItems.add(0, EditMsgText.getText().toString());
                aa.notifyDataSetChanged();

                return true;
                }
                return false;
                }
                });




Question:

how can i add 1 button in this listAdapter so button also appear each
time along with the editText in the list view

anyone help me please ASAP.

thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to