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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:44:12+00:00 2026-05-22T15:44:12+00:00

There was a question concerning removal of appendices in the program. I use such

  • 0

There was a question concerning removal of appendices in the program. I use such code:

import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;


public class dop extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.dop);
    PackageManager pm = this.getPackageManager();

    Intent intent = new Intent(Intent.ACTION_MAIN, null);
    intent.addCategory(Intent.CATEGORY_LAUNCHER);

    List<String> myList = new ArrayList<String>();
    ArrayList<ResolveInfo> list = (ArrayList<ResolveInfo>) pm.queryIntentActivities(intent, PackageManager.PERMISSION_GRANTED);
    for (ResolveInfo rInfo : list) {
    System.out.println("Installed Applications " + rInfo.activityInfo.applicationInfo.loadLabel(pm).toString());
    myList.add(rInfo.activityInfo.applicationInfo.loadLabel(pm).toString());
    }
    ListView listView = (ListView) findViewById(R.id.list);
    ArrayAdapter<String> aa = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, myList);
    listView.setAdapter(aa);

    }
    public void onListItemClick(
            ListView parent, View v, int position, long id) {
        Intent intent = new Intent(Intent.ACTION_DELETE);
        intent.setData(Uri.parse("package:"+"some.package.to.remove"));
        startActivity(intent);
    }
}

But the removal code doesn’t work. What I not so do?

  • 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-22T15:44:13+00:00Added an answer on May 22, 2026 at 3:44 pm

    onListItemClick() is available only in ListActivity (and it’s actually a protected member), so basically you’re not overriding anything and that method is never getting called.

    (to be sure you’re overriding something, put @Override before that method, the compiler will complain if that’s not an override and you’ll know something is wrong there)

    As you’re building an Activity, you’ll need to make it implement OnItemClickListener, and in onCreate() set this listener on the ListView:

    public class dop extends Activity implements OnItemClickListener {
    //.....
        public void onCreate(Bundle bndl) {
            //....
            listView.setOnItemClickListener(this);
        }
    
        @Override
        public void onItemClick(/*...*/) {
            // put here your click code
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question concerning page speed and code optimization. I have a page
I've got a question concerning ajaxSetup . When the script starts, I define the
A very basic question concerning dropBox integration into an iPhone app. I followed the
This is purely a coding practice question concerning VB.NET structures. Where do you keep
This is a follow up question to my earlier question concerning returning references in
There are tons of resources concerning coding on the iPhone. Most of them concern
In order to support automated testing tools I need to x:Name all controls (so
Say we have a concrete class A, and an abstract class B. Consider a
I am trying to do something similar to what the user who asked this
I've been getting up to speed on SVN and have an idea of the

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.