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

The Archive Base Latest Questions

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

I am allowing the user to create multiple SharedPreferences files, but I also would

  • 0

I am allowing the user to create multiple SharedPreferences files, but I also would like the option for them to delete these files. I know I could use internal storage, but that is not my question.

My question is: “How can I delete in code or manually (not just clear) a SharedPreferences file?”

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

    If you get SharedPreferences instance via Context.getSharedPreferences("X"), then your file will be named X.xml.

    It will be located at /data/data/com.your.package.name/shared_prefs/X.xml. You can just delete that file from the location. Also check /data/data/com.your.package.name/shared_prefs/X.bak file, and if it exists, delete it too.

    But be aware, that SharedPreferences instance saves all data in memory. So you’ll need to clear preferences first, commit changes and only then delete preferences backing file.

    This should be enough to implement your design decision.

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

Sidebar

Related Questions

As you can see here , I'm allowing a user to dynamically create a
Salutations, I am having problems allowing user's(admin) the ability to upload files/images to the
I have a form allowing a user to signup for a news letter which
I have an input form with two textareas allowing a user to type in
I'm retrieving a file from a database server and allowing the user to download
I have a web application that functions as a dashboard, allowing a user to
I am generating user control according to search result. And allowing to change text
I'm allowing authenticated users to upload image files with my PHP application. Assume I've
My VB6 application is backed by a MS Access database. Allowing user to open
I have a contact manager program that I'd like to design for multiple network

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.