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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:08:13+00:00 2026-06-08T18:08:13+00:00

I have a broad cast receiver for my application which listens uninstalling a package,

  • 0

I have a broad cast receiver for my application which listens uninstalling a package, and then it will start a transparent activity as requirement. (My application itself have an option to uninstall a package that is related to my other application only) I registered my receiver in manifest as follows.

<receiver android:name=".PackageRemoveReceiver">
        <intent-filter>
            <action android:name="android.intent.action.PACKAGE_REMOVED"/> 
            <data android:scheme="package"/>
        </intent-filter>
    </receiver>  

My receiver class is as follows.

public void onReceive(Context context, Intent intent) {
    // TODO Auto-generated method stub 
    this.context = context;
    boolean replacing = intent.getBooleanExtra(Intent.EXTRA_DATA_REMOVED, false);
    Log.d("Log","getting receivers");
    if(replacing){
        ......
                    ......


        startActivity(context);
    } 

   private void startActivity(Context context) {
    // TODO Auto-generated method stub 
    Intent i = new Intent(context, TransparentActivity.class);
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(i);

}    

so, after listening the intent it is opening my activity. Up to here it is working fine.

But, whenever am doing something like uninstalling different applications (other than my applications ) from settings, it always listening and opens my transparent activity.

I want to run broad cast only , whenever a particular package removed. Is it possible, if yes how to do it?

  • 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-08T18:08:14+00:00Added an answer on June 8, 2026 at 6:08 pm

    Check for the package name in onReceive():

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getDataString().equals("package:your.package.name")) {
            ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to start a broadcast receiver from an activity. I have a
I'm using C2DM in my application, and I have a receiver, which sends data
Hi I have an application which after login, loads a main activity which contains
I have an application, which sets an alarm using AlarmManager, which starts another Activity
I have application with BroadcastReceiver which listens to SD card mount/unmount, like: public class
I have a simple broadcast receiver set to receive system intents informing my application
I have an broadcast-receiver that looks like the following within an activity named childActivity
I have a broadcast receiver which receive an internet state changes. I want to
I have an application which is keeping a log of internally developed applications installed
I have Android application which is Sales Rep application.When he using the app first

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.