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 6839743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:45:22+00:00 2026-05-26T23:45:22+00:00

In my application, I am using this code to show the List View with

  • 0

In my application, I am using this code to show the List View with Section.
But with this way I am not able to get that which listItem I am going to select. I mean I am not able to see the chang colour while I am going to press on any list item. So how to make it possible for this code:

    public static ProgressDialog  m_progressDialog; 
    public Map<String,?> createItem(String title, String caption) {   
        Map<String,String> item = new HashMap<String,String>();   
        item.put(ITEM_TITLE, title);   
       item.put(ITEM_CAPTION, caption);   
        return item;   
    }   

    @Override  
    public void onCreate(Bundle icicle) {   
        super.onCreate(icicle);  
        setContentView(R.layout.main);

        // create our list and custom adapter   
        SeparatedListAdapter adapter = new SeparatedListAdapter(this);   
        adapter.addSection("Local documents:", new ArrayAdapter<String>(this,   
            R.layout.list_item, new String[] { "WindowsONE Mobile PK", "WindowsorONE Moldings","Filet for a burger video" }));
        adapter.addSection("Non-local resources:", new ArrayAdapter<String>(this,   
                R.layout.list_item, new String[] { "Launch Photo slideshow link", "Dealer locator link" }));
        adapter.addSection("Send emails:", new ArrayAdapter<String>(this,   
                R.layout.list_item, new String[] { "Send Dealer Locator email", "Send Catalog email","Send install instrucation link" })); 
        //For extra Information in Listview    
        //adapter.addSection("Non-local resources:", new SimpleAdapter(this, security, R.layout.list_complex,   
        //new String[] { ITEM_TITLE, ITEM_CAPTION }, new int[] { R.id.list_complex_title, R.id.list_complex_caption }));        
        ListView list = getListView();
        list.setAdapter(adapter);   
        list.setTextFilterEnabled(true);
        list.setOnItemClickListener(this); 
}

}

  • 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-26T23:45:23+00:00Added an answer on May 26, 2026 at 11:45 pm

    You can define a touch Listener to your list view and you can show the touch like

     ListView.setOnTouchListener(List_onTouch);
    

    add a touch listner named List_onTouch

        OnTouchListener List_onTouch=new OnTouchListener(){
    @Override
    public boolean onTouch(View arg0,MotionEvent arg1){
        int iAction=arg1.getAction();
        if(iAction==0){
            ls2.setBackgroundcolor(Color.white);
        }
        else{
     ls2.setBackgroundcolor(Color.orange);     
       }
        return false;
    }
    };
    

    ls2 is your listViewObject and if you click the list it will change your colour to orange

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

Sidebar

Related Questions

I'm using this code from Microsoft to play audio notifications for my application. It's
In many places in our application we have code like this: using(RAPI rapi =
I'm using http://code.google.com/p/flex-iframe/ for showing html in an flex application. To set this up
For example, your application is using this way for passing vars into your application
I'm using this method to install an application, but it doesn't put the applications
I have an application using a MySql database which is displaying a paginated list
i am using MapActivity in my application to show map and for that i
I am using this code to Implement the ListView with section: public class ListSample
I deployed an application using this method and it worked very good. However, there
I am making a test fullscreen application using this guide . However, I am

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.