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

Inspired by this question. Why is there no list.clear() method in python? I've found
My question is concerning an application that will use a host application where the
there have been hundreds if not thousands of posts concerning the use of PHP's
There's a similar question concerning a field's verbose_name : How to stop auto-capitalization of
I have a question concerning page speed and code optimization. I have a page
Newbie question: There are three types of Asp.Net controls : HTML server controls, Web
Here is my question - There are two classes Order and PaymentType . An
I have a job interview tomorrow and I'm trying to answer this question: There
Simple question: Is there a class or interface that encapulates the getting of a
there's a question: Is there any way to pair Bluetooth device in Windows programmatically?

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.