Available Methods
- getSystemService ( )
- obtainStyledAttributes ( )
- startActivity ( )
- getSharedPreferences ( )
- getApplicationContext ( )
- getString ( )
- getResources ( )
- getPackageManager ( )
- startService ( )
- getPackageName ( )
- getContentResolver ( )
- sendBroadcast ( )
- getCacheDir ( )
- getFilesDir ( )
- getApplicationInfo ( )
- toString ( )
- registerReceiver ( )
- getAssets ( )
- getExternalFilesDir ( )
- getExternalCacheDir ( )
- getDir ( )
- unregisterReceiver ( )
- bindService ( )
- openFileOutput ( )
- stopService ( )
- checkCallingOrSelfPermission ( )
- getTheme ( )
- unbindService ( )
- startForegroundService ( )
- getMainLooper ( )
- deleteDatabase ( )
- getClassLoader ( )
- getDatabasePath ( )
- openFileInput ( )
- MODE_PRIVATE
- checkSelfPermission ( )
- getDrawable ( )
- checkPermission ( )
- deleteFile ( )
- createConfigurationContext ( )
- getColor ( )
- grantUriPermission ( )
- CONTEXT_DEVICE_PROTECTED_STORAGE
- getExternalFilesDirs ( )
- getFileStreamPath ( )
- CONTEXT_CREDENTIAL_PROTECTED_STORAGE
- sendOrderedBroadcast ( )
- setTheme ( )
- MODE_MULTI_PROCESS
- checkCallingOrSelfUriPermission ( )
- getText ( )
- createPackageContext ( )
- openOrCreateDatabase ( )
- isRestricted ( )
- NOTIFICATION_SERVICE
- BIND_AUTO_CREATE
- startActivities ( )
- getPackageCodePath ( )
- createDeviceProtectedStorageContext ( )
- getExternalCacheDirs ( )
- CONTEXT_IGNORE_SECURITY
- registerComponentCallbacks ( )
- revokeUriPermission ( )
- getColorStateList ( )
- CONTEXT_RESTRICTED
- checkCallingPermission ( )
- BIND_IMPORTANT
- deleteSharedPreferences ( )
- getClass ( )
- getCodeCacheDir ( )
- BIND_DEBUG_UNBIND
- MODE_WORLD_READABLE
- startServiceAsUser ( )
- getSharedPreferencesPath ( )
- enforceCallingOrSelfPermission ( )
- BIND_TREAT_LIKE_ACTIVITY
- getObbDir ( )
- getObbDirs ( )
- LOCATION_SERVICE
- moveSharedPreferencesFrom ( )
- CONTEXT_INCLUDE_CODE
- bindServiceAsUser ( )
- BIND_ABOVE_CLIENT
- removeStickyBroadcast ( )
Related Classes
- java.io.File
- java.io.InputStream
- android.os.Bundle
- android.view.View
- java.util.Date
- android.util.Log
- android.widget.TextView
- android.content.Intent
- android.view.ViewGroup
- android.app.Activity
- java.io.FileOutputStream
- java.util.Locale
- android.view.LayoutInflater
- android.os.Build
- android.widget.Toast
- android.util.AttributeSet
- android.widget.ImageView
- android.graphics.Color
- android.os.Handler
- android.net.Uri
- android.graphics.Bitmap
- android.text.TextUtils
- android.graphics.Paint
- android.graphics.drawable.Drawable
- android.widget.LinearLayout
Java Code Examples for android.content.Context#deleteSharedPreferences()
The following examples show how to use
android.content.Context#deleteSharedPreferences() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SessionTest.java From snowplow-android-tracker with Apache License 2.0 | 6 votes |
@Override protected void setUp() throws Exception { super.setUp(); Context context = getContext(); FileStore.deleteFile(TrackerConstants.SNOWPLOW_SESSION_VARS, context); if (Build.VERSION.SDK_INT >= 24) { context.deleteSharedPreferences(TrackerConstants.SNOWPLOW_SESSION_VARS); } else { SharedPreferences.Editor editor = context.getSharedPreferences(TrackerConstants.SNOWPLOW_SESSION_VARS, Context.MODE_PRIVATE).edit(); editor.remove(Parameters.SESSION_USER_ID); editor.remove(Parameters.SESSION_ID); editor.remove(Parameters.SESSION_PREVIOUS_ID); editor.remove(Parameters.SESSION_INDEX); editor.remove(Parameters.SESSION_FIRST_ID); editor.remove(Parameters.SESSION_STORAGE); editor.commit(); } }
Example 2
Source File: AttestationProtocol.java From Auditor with MIT License | 5 votes |
static void clearAuditor(final Context context) { PreferenceManager.getDefaultSharedPreferences(context) .edit().remove(KEY_CHALLENGE_INDEX).apply(); final File dir = new File(context.getFilesDir().getParent() + "/shared_prefs/"); for (final String file : dir.list()) { if (file.startsWith(PREFERENCES_DEVICE_PREFIX)) { final String name = file.replace(".xml", ""); Log.d(TAG, "delete SharedPreferences " + name); context.deleteSharedPreferences(name); } } }
Example 3
Source File: Book.java From BookyMcBookface with GNU General Public License v3.0 | 5 votes |
public static void remove(Context context, File file) { try { FsTools.deleteDir(getBookDir(context, file)); String fname = getProperFName(context, file); if (Build.VERSION.SDK_INT >= 24) { context.deleteSharedPreferences(fname); } else { getStorage(context, file).edit().clear().commit(); } } catch (Exception e) { Log.e("Book", e.getMessage(),e); } }