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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:49:58+00:00 2026-06-09T11:49:58+00:00

I have a listview, basically I would like to have the Listview populated and

  • 0

I have a listview, basically I would like to have the Listview populated and display a TextView that says “New” if the user has not clicked on that position yet, and then make the TextView visibility set to gone after the user has clicked on that Listview item. could anyone help me?

I have tried quite a bit of messing with some codes, of course with trial and error, comes erasing the code so I wasnt able to show you everything that I have tried. This is the last thing I tried:

        // selecting single ListView item
    final ListView lv = getListView();



    // Launching new screen on Selecting Single ListItem
    lv.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view,
                int position, long ide) {

            if (lv.isPressed(view.hasFocus(position))) { 
                newjob.setVisibility(View.VISIBLE); 
            } else { 
                newjob.setVisibility(View.GONE); 
            } 


               vib.vibrate(40); 

                // Starting new intent 
                try { 
                Intent in = new Intent(getApplicationContext(), 
                        SingleMenuItemActivity.class); 
                in.putExtra("jobInfo", JOBS.getJSONObject(position).toString()); 
                in.putExtra(pays, JOBS.getJSONObject(position).toString());
                in.putExtra(job, JOBS.getJSONObject(position).toString());
                in.putExtra(ready_at, JOBS.getJSONObject(position).toString());
                in.putExtra(due_by, JOBS.getJSONObject(position).toString());
                in.putExtra(customer_reference, JOBS.getJSONObject(position).toString());
  • 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-09T11:50:00+00:00Added an answer on June 9, 2026 at 11:50 am

    Here is one way, simply override the OnItemClickListener:

    lv.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            // Change your TextView's visibility to gone
            view.findViewById(R.id.textView).setVisibility(View.GONE);
        }
    });
    

    Updated from new code

    It looks like you are using a ListActivity or ListFragment. If so, I recommend using onListItemClick() instead of onItemClick() since it is already set up:

    @Override
    protected void onListItemClick (ListView listView, View view, int position, long id) {
        view.findViewById(R.id.textView).setVisibility(View.GONE);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView and each item have a TextView. I would like add
So i basically have this ListView and i would like to press Tab and
I have ListView that has the following EditItemTemplate: <EditItemTemplate> <tr style=> <td> <asp:LinkButton ID=UpdateButton
I have ListView that uses a GridView to display several columns of data. Two
I have a custom ListView that uses a custom ArrayAdapter (which basically just overrides
http://img804.imageshack.us/img804/9858/howtowrapmiddletext.png Basically I have a listview that is split in three sections. On the
I have a ListView that has two columns, one for a zone name and
I would like to call one of the activities that I have written in
i have a listview that use a simple adapter. Basically each element consist of
I have multiple tabs that have different data inside. The first tab has ListView

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.