Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/org/adblockplus/sbrowser/contentblocker/MainPreferences.java

Issue 29356463: Issue 4512 - Move preferences file to xml directory (Closed)
Patch Set: Created Oct. 10, 2016, 2:09 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 private SharedPreferences getSharedPreferences() 50 private SharedPreferences getSharedPreferences()
51 { 51 {
52 return PreferenceManager.getDefaultSharedPreferences(this.getApplicationCont ext()); 52 return PreferenceManager.getDefaultSharedPreferences(this.getApplicationCont ext());
53 } 53 }
54 54
55 @Override 55 @Override
56 public void onCreate(Bundle savedInstanceState) 56 public void onCreate(Bundle savedInstanceState)
57 { 57 {
58 super.onCreate(savedInstanceState); 58 super.onCreate(savedInstanceState);
59 PreferenceManager.setDefaultValues(this, R.layout.preferences_main, false); 59 PreferenceManager.setDefaultValues(this, R.xml.preferences_main, false);
60 60
61 this.getFragmentManager() 61 this.getFragmentManager()
62 .beginTransaction() 62 .beginTransaction()
63 .replace(android.R.id.content, new Preferences()) 63 .replace(android.R.id.content, new Preferences())
64 .commit(); 64 .commit();
65 65
66 // This try/catch block is a workaround for a preference mismatch 66 // This try/catch block is a workaround for a preference mismatch
67 // issue. We check for a type mismatch in one particular key and, 67 // issue. We check for a type mismatch in one particular key and,
68 // if there's a mismatch, clean sweep the preferences. 68 // if there's a mismatch, clean sweep the preferences.
69 // See: https://issues.adblockplus.org/ticket/3931 69 // See: https://issues.adblockplus.org/ticket/3931
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 r.close(); 247 r.close();
248 } 248 }
249 } 249 }
250 catch (IOException e) 250 catch (IOException e)
251 { 251 {
252 Log.e(TAG, "Resource reading failed for: " + id, e); 252 Log.e(TAG, "Resource reading failed for: " + id, e);
253 return "..."; 253 return "...";
254 } 254 }
255 } 255 }
256 } 256 }
OLDNEW
« no previous file with comments | « res/xml/preferences_main.xml ('k') | src/org/adblockplus/sbrowser/contentblocker/Preferences.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld