-1

I want to have a list view with each row having two buttons like this

         ---------------------------------------------------------------
            [TEXTVIEW]                           [BUTTON][TV][BUTTON]
         ---------------------------------------------------------------

Here I have a onClick for the Buttons to perform some function.

Apart from this I also want to get the onItemClick for the the whole list row also. which on click will give me the rowId which i'll be using to call another method...

Need some assist with the above mentioned....

public class MyListAdapter extends ArrayAdapter {
    Activity contextACT;

    @Override
    public void notifyDataSetChanged() {
        super.notifyDataSetChanged();
    }

    public MyListAdapter(Activity context) {
        super(context, R.layout.nrrow_of_list_lesson, dummyVal);
        this.contextACT = context;
    }

    public View getView(final int row_position, View convertView,
            ViewGroup parent) {
        LayoutInflater inflator = contextACT.getLayoutInflater();
        final View row = inflator.inflate(R.layout.nrrow_of_list_lesson,
                null);
        final TextView name = (TextView) row.findViewById(R.id.lessonname);
        final TextView period = (TextView) row.findViewById(R.id.TVmid);
        TextView slNumber = (TextView) row.findViewById(R.id.lessonslno);
        final Button increase = (Button) row.findViewById(R.id.BTIncrease);
        final Button decrease = (Button) row.findViewById(R.id.BTDecrease);
}

Since I have a button's Onclick i'm not able to get the rowList's onItemClickListener....

Vivekanand
  • 755
  • 1
  • 8
  • 29
  • 1
    please search in google before u ask buddy, thousands of examples lying on internet...!!! – mayank_droid Jan 05 '12 at 11:44
  • Maann i know how to get a CustomList view... i just need to know if i could get the ItemClickListener for the list... y dont u post some links in tat case – Vivekanand Jan 05 '12 at 11:53

1 Answers1

1

http://www.vogella.de/articles/AndroidListView/article.html you need to customize according to you by using an adapter for listview.....

Gray
  • 7,050
  • 2
  • 29
  • 52
NikhilReddy
  • 6,904
  • 11
  • 38
  • 58
  • oh yes tat i've done ..... i used a arrayListAdapter... I'm able to get a list with all the attributes... all that i wanna know is, can I get ClickListener or the List ROw.... – Vivekanand Jan 05 '12 at 11:50
  • 1
    http://stackoverflow.com/questions/4461134/android-listview-adapter-onclicklistener-issue go through this link... – NikhilReddy Jan 05 '12 at 11:53
  • hey man Nikhil let me post the code... might give u some idea what i'm talkin about... – Vivekanand Jan 05 '12 at 11:57