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

  • Home
  • SEARCH
  • 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 9174431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:45:23+00:00 2026-06-17T16:45:23+00:00

In my project I have a list view consisting of list items each containing

  • 0

In my project I have a list view consisting of list items each containing an image. Now when a particular list item is clicked, new activity with respect to that item is opened and it has 3 buttons. Depending on which button is clicked the image in that particular list item is changed.
Each list item is associated with specific row from the database, I wanted to know how do I recognize the particular button click and change image view directly in the list item.

My custom Adapter’s getView() Method is as follows

    public class SpecialAdapter extends SimpleCursorAdapter{

    private EventDBAdapter dbHelper;

@SuppressWarnings("deprecation")
public SpecialAdapter(Context context, int layout, Cursor c, String[] from,
        int[] to, int i) {
    super(context, layout, c, from, to);
    // TODO Auto-generated constructor stub
}

private int[] colors = new int[] { 0xAAFFFFF, 0xAAc0c0c0 };

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub


      View view = super.getView(position, convertView, parent);
      int colorPos = position % colors.length;
      view.setBackgroundColor(colors[colorPos]);
      return view;
}

    }

Each list item is inflated from this view

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="5dp"
 >

<View
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_toLeftOf="@+id/tvListTitle"
android:paddingLeft="10dp"
android:background="#CC3232"/>

<TextView
    android:id="@+id/tvListTitle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textStyle="bold"
    android:layout_marginTop="10dp"
    android:textColor="#108070"
    android:text="Title in list"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
    android:id="@+id/tvListTime"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="00:00 to 00:00"
    android:layout_below="@+id/tvListTitle"
    android:textColor="#138F6A"
    android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
    android:id="@+id/tvListWhere"
    android:layout_width="wrap_content"
    android:layout_below="@+id/tvListTime"
    android:layout_height="wrap_content"
    android:text="Crystal plaza , Andheri (West) . "
    android:textColor="#138F6A"
    android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
    android:id="@+id/tvListDetails"
    android:layout_width="250dp"
    android:layout_below="@+id/tvListWhere"
    android:layout_height="20dp"
    android:text="This is gonna contain brief summary about the event"
    android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
    android:id="@+id/tvListDate"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="14th January"
    android:layout_alignParentTop="true"
    android:layout_alignParentRight="true"
    android:textAppearance="?android:attr/textAppearanceSmall" />

<TextView
    android:id="@+id/tvListDay"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/tvListDetails"
    android:text="Monday"
    android:textAppearance="?android:attr/textAppearanceMedium" />

<ImageView
    android:id="@+id/ivStatus"
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/tvListWhere"
    android:src="@drawable/yes" />

 </RelativeLayout>
  • 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-06-17T16:45:24+00:00Added an answer on June 17, 2026 at 4:45 pm

    Solved , i am using the url of image on SD card and storing it in the sqlite db and populating list view with contents of database row wise

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

Sidebar

Related Questions

I have a list view and each item is rendered as follows <?xml version=1.0
In my project, I have a list box. When I click an item on
My project is .NET/WinForms. I have a list view which is always filled with
I have an android activity that consists of a List View and a Text
In my mvc project i have a simple list of items with crud operations
I have been using a Winform ListView in my project. When the list view
In a Silverlight project I have a view with a list (DataGrid) of cases.
I have a view in a Django 1.4 project: def index(request): print reverse('menus_index') latest_menu_list
I have a problem with list and listview. I started a project and added
I have a list of webservices from a Flex project. I am trying to

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.