Note that there are some explanatory texts on larger screens.

plurals
  1. POdynamic listview buttons problem intent in android
    primarykey
    data
    text
    <p>I have query in dynamic listview buttons. I have 2 buttons in my dynamic listview. I can see the onclick event and toast appears. But when I try to pass a intent to next activity it is not working. Kindly tell me where I am doing wrong. </p> <p>My code:</p> <pre><code>ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.adaptor_content, null); // Creates a ViewHolder and store references to the two children // views // we want to bind data to. holder = new ViewHolder(); holder.textLine = (TextView) convertView.findViewById(R.id.textLine); // holder.iconLine = (ImageView) convertView.findViewById(R.id.iconLine); holder.buttonLine = (Button) convertView.findViewById(R.id.buttonLine); holder.DbuttonLine = (Button) convertView.findViewById(R.id.DbuttonLine); holder.textLine2 =(TextView) convertView.findViewById(R.id.textLine2); holder.mobile =(TextView) convertView.findViewById(R.id.mobile); holder.newmes =(TextView) convertView.findViewById(R.id.newmessage); convertView.setOnClickListener(new OnClickListener() { private int pos = position; @Override public void onClick(View v) { Toast.makeText(context, "Click-" + String.valueOf(pos), Toast.LENGTH_SHORT).show(); } }); holder.buttonLine.setOnClickListener(new OnClickListener(){ private int pos = position; @Override public void onClick(View v) { //Toast.makeText(context, "Delete-" + String.valueOf(pos), Toast.LENGTH_SHORT).show(); Intent myIntent = new Intent(v.getContext(), messsagelist.class); //startActivity(myIntent); this.startActivityForResult(myIntent, 0); } private void startActivityForResult(Intent myIntent, int i) { // TODO Auto-generated method stub } }); holder.DbuttonLine.setOnClickListener(new OnClickListener() { private int pos = position; @Override public void onClick(View v) { Toast.makeText(context, "Details-" + String.valueOf(pos), Toast.LENGTH_SHORT).show(); } }); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload