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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:22:34+00:00 2026-05-26T21:22:34+00:00

I am developing an Android app which creates a folder in SD Card and

  • 0

I am developing an Android app which creates a folder in SD Card and stores some images. I want to remove that folder when the app is Uninstalled. Please guide me.

  • 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-26T21:22:35+00:00Added an answer on May 26, 2026 at 9:22 pm

    //for that you need to run the BroadcasrReciver and include the receiver in your androidmanifest.xml file

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

    // add permission

     <uses-permission android:name="android.permission.BROADCAST_PACKAGE_REMOVED" />
    

    // in that PackageChangeReceiver just delete the file I am deleting the doc file in this below code

    public class PackageChangeReceiver extends BroadcastReceiver 
    {
        @Override
        public void onReceive(Context context, Intent intent) 
        {
        //this.context=context;
        Uri data = intent.getData();
        Log.d("hi", "Action: " + intent.getAction());
        Log.d("hi", "The DATA: " + data);
    
        String action=intent.getAction();
    
        if(Intent.ACTION_PACKAGE_REMOVED.equalsIgnoreCase(action))
        {
    
             String PATH = Environment.getExternalStorageDirectory() + "/mycontent_download/"; 
               File file = new File(PATH);
    
               if (file.exists())
               {
                  String listOfFiles [] = file.list();
                   if (listOfFiles!=null)
                   {
                      if (listOfFiles.length>0)
                      {
                          int size = listOfFiles.length;
                          for (int i=0; i<size; i++)
                          {
                              if (listOfFiles[i].substring(listOfFiles[i].length()-4, listOfFiles[i].length()).equalsIgnoreCase(".doc"))
                              {
                                  File f1 = new File(PATH+listOfFiles[i]);
                                  f1.delete();
                              }
    
                          }
                        }
                      }
                   }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an Android App that gets some data from a web server,
I'm currently developing an Android application that fetches images using http requests. It would
I'm kinda noob to android so please bear with me. I'm currently developing app
I am developing an Android app which needs to poll a specific webpage in
I have an Android app, in which Activities fire long running operations that run
Currently I'm developing an Android app which draws a point on the coordinates input
I am developing an android app which requires search functionality. My app contains action
I'm developing an android app, which is supposed to ask questions at random time.
I am currently developing an android app where I create a notification Intent which
I'm developing an Android project which currently has 4 packages: com.myapp.app.activities com.myapp.app.db com.myapp.app.ws com.myapp.app.utils

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.