Situation:
- I have a
ListViewwith my ownListAdapter. - In every row I have two
Buttons.
I’m trying to implement the onClick methods for the two Buttons, but I don’t find the right solution. This is the getView method from my ListAdapter with my two Buttons:
public View getView(final int groupPosition, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = inflater.inflate(R.layout.modul_item, null);
}
TextView tv = (TextView) convertView.findViewById(R.id.modul_title);
tv.setText(modul_overviewActivity.getvalue().get(groupPosition));
Button Button_1 = (Button)convertView.findViewById(R.id.button1);
Button Button_2 = (Button)convertView.findViewById(R.id.button2);
return convertView;
}
- In my
OnCLickListenersI want to change parameters of theObjectswhich are displayed in theListView. - The Name of the
Objectsis displayed, but they have a few more parameters (variables), which I want to edit in anotherActivity. - This
Activityshould open if I click one of theButtons.
I didn’t understand exactly what you want to do in your button listeners but check this code:
This is just for starting a new activity, the intent could carry more data to the new activity so you can send other important information(like the position of the element for which to calculate stuff, this depends of what kind of data and how you store it ).