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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:07:17+00:00 2026-05-27T19:07:17+00:00

Update : I found the solution by removing v.setFocusable(true); v.setClickable(true); in the code and

  • 0

Update : I found the solution by
removing

v.setFocusable(true);
v.setClickable(true); in the code

and only add

v.setEnabled(true);

and in my xml (ListView) add

android:drawSelectorOnTop="true"
android:focusable="true"


When I click it nothing happens , even the list view doesn’t focus.

I have tried to add all this:

           v.setClickable(true);
           v.setEnabled(true); 
           v.setFocusable(true);

Only this will work is i add the following code:

But this doesn’t determine what item is being clicked

How to handle ListView click in Android

and the result still the same.

Here’s is the code :

public class AppsInspectorActivity extends Activity {
     /** Called when the activity is first created. */
     @Override
        public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
//[...]
    ListView app_listView = (ListView)findViewById(R.id.listview);

// I try setOnItemClickListene here - 1
    app_listView.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {
            Toast.makeText(getApplicationContext(), "I Clicked on Row " + position + ".", Toast.LENGTH_SHORT).show();

        }
    });
}

Adapter

 public class AppAdapter extends BaseAdapter {

            Context context;
            ArrayList<AppInfo> dataList=new ArrayList<AppInfo>();
            public AppAdapter(Context context,ArrayList<AppInfo> inputDataList)
            {

                this.context = context;
                dataList.clear();
                for(int i=0;i<inputDataList.size();i++)
                {
                    dataList.add(inputDataList.get(i));
                }
            }
            public int getCount() {
                // TODO Auto-generated method stub
                return dataList.size();
            }

            public Object getItem(int position) {
                // TODO Auto-generated method stub
                return dataList.get(position);
            }

            public long getItemId(int position) {
                // TODO Auto-generated method stub
                return position;
            }

            public View getView(int position, View convertView, ViewGroup parent) {

                View v=convertView;
                final AppInfo appUnit = dataList.get(position);

                ListView app_listView = (ListView)findViewById(R.id.listview);

                /** Remove this , i just try to add to see setOnItemClickListener will work at here or not **/
                 app_listView.setOnItemClickListener(new OnItemClickListener() {
                    public void onItemClick(AdapterView<?> parent, View view,
                      int position, long id) {
                    Toast.makeText(getApplicationContext(), "I Clicked on Row " + position + ".", Toast.LENGTH_SHORT).show();
                  }
                });

                if(v==null)
                {
                    LayoutInflater vi=(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                    v=vi.inflate(R.layout.app_row, null);
                    v.setClickable(true);
                    v.setEnabled(true); 
                    v.setFocusable(true);           
                }


                TextView appName=(TextView)v.findViewById(R.id.appName);
                ImageView appIcon=(ImageView)v.findViewById(R.id.AppIcon);

                if(appName!=null)
                    appName.setText(appUnit.appName);
                if(appIcon!=null)
                    appIcon.setImageDrawable(appUnit.appIcon);
                return v;
            }
         }
 }
}
  • 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-27T19:07:17+00:00Added an answer on May 27, 2026 at 7:07 pm

    I found the solution by removing

    v.setFocusable(true); v.setClickable(true); in the code

    and only add

    v.setEnabled(true);

    and in my xml (ListView) add

    android:drawSelectorOnTop="true" android:focusable="true"

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

Sidebar

Related Questions

Right guys, all autocomplete plugins and functions that I've found, they only update upon
UPDATE: I found a solution. See my Answer below. My Question How can I
I found a solution for people who get an exception: Store update, insert, or
UPDATE I am still debugging this issue and still have not found a solution.
I found javascript solution for removing gridlines on Google docs spreadsheets (using download as
Update: I found the solution, look in the bottom of this page... I've got
12:18:55,541 INFO [UpdateChecker] New update(s) found: 2.0.0 [ http://ehcache.org/news.html] How do I suppress ehcache
[Update: I've found the API reference. The method used is below] <?php wp_delete_post( $postid,
All the documentation I've found so far is to update keys that are already
I found something that works with updating one field at here: http://www.karlrixon.co.uk/articles/sql/update-multiple-rows-with-different-values-and-a-single-sql-query/ UPDATE person

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.