Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6097485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:02:55+00:00 2026-05-23T13:02:55+00:00

I have created an customListview where i have inserted an button..now on click of

  • 0

I have created an customListview where i have inserted an button..now on click of that button i want to start new activity..how that can be done the code for creating custom listview is given below..can anyone tell me how i interact with that button to start a new activity..

code:

public static class ViewHolder
{
    Button butAddNew;
    TextView txtViewHeading;
    TextView  txtViewTitle;
    TextView  txtViewDescription;

}
public View getView(int position, View convertView, ViewGroup parent) 
{
    ViewHolder holder;

    if(convertView==null)
    {
        holder = new ViewHolder();
        convertView = inflater.inflate(R.layout.histryfrm_listview, null);
        holder.butAddNew =(Button) convertView.findViewById(R.id.butAddNew);
        holder.txtViewTitle =(TextView) convertView.findViewById(R.id.txtViewTitle);
        holder.txtViewDescription =(TextView) convertView.findViewById(R.id.txtViewDescription);
        holder.txtViewHeading =(TextView) convertView.findViewById(R.id.txtViewHeading);

        convertView.setTag(holder);
    }
    else
        holder=(ViewHolder)convertView.getTag();

    holder.txtViewTitle.setText(title[position]);
    holder.txtViewDescription.setText(description[position]);
    holder.txtViewHeading.setText(heading[position]);
    return convertView;
} 
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:02:57+00:00Added an answer on May 23, 2026 at 1:02 pm

    You could always send a onClickListener from your Activity to your adapter when you create it.

    Otherwise set a listener in your adapter or by using the onClick in the xml of the item.

    When I did similar things I passed my activities onclicklistener to my adapter.

    Edit:
    Examples:

    http://androidforbeginners.blogspot.com/2010/03/clicking-buttons-in-listview-row.html

    Or better:

    Android: ListView elements with multiple clickable buttons

    It all depends on how you will do it.
    But the other answer will probably work, just pass the correct context.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have created a workflow activity that do give the item creater of a
I have created sample application that insert 12 rows in tableview.And inserted fine.When after
I have a Custom ListView created from XML Layout. I want to bind that
I have created two buttons using the following XAML code. <Button x:Name=Button1 Width=100 Content=Button1
I have created a data base (.sqlite) using SQLiteManager plugin for firefox,now I want
I have created a PHP-script to update a web server that is live inside
I have created a UserControl that has a ListView in it. The ListView is
I have created a few small flash widgets that stream .mp3 audio from an
Have created simple Ajax enabled contact forms before that have around 12 fields -
I have created alot of stored procedures in my application that return the result

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.