| Index: src/org/adblockplus/sbrowser/contentblocker/MainPreferences.java |
| =================================================================== |
| --- a/src/org/adblockplus/sbrowser/contentblocker/MainPreferences.java |
| +++ b/src/org/adblockplus/sbrowser/contentblocker/MainPreferences.java |
| @@ -102,17 +102,17 @@ public class MainPreferences extends Pre |
| private void checkForCompatibleSBrowserAndProceed() |
| { |
| if (!Engine.hasCompatibleSBrowserInstalled(this.getApplicationContext())) |
| { |
| final AlertDialog d = new AlertDialog.Builder(this) |
| .setCancelable(false) |
| .setTitle(R.string.sbrowser_dialog_title) |
| - .setMessage(Html.fromHtml(this.readTextFile(R.raw.sbrowser_dialog))) |
| + .setMessage(Html.fromHtml(getString(R.string.sbrowser_dialog_message))) |
| .setNeutralButton(R.string.sbrowser_dialog_button, new OnClickListener() |
| { |
| @Override |
| public void onClick(DialogInterface dialog, int which) |
| { |
| try |
| { |
| startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" |
| @@ -138,17 +138,17 @@ public class MainPreferences extends Pre |
| final SharedPreferences prefs = this.getSharedPreferences(); |
| final String keyAaInfoShown = this.getString(R.string.key_aa_info_shown); |
| final boolean aaInfoShown = prefs.getBoolean(keyAaInfoShown, false); |
| if (!aaInfoShown) |
| { |
| final AlertDialog d = new AlertDialog.Builder(this) |
| .setCancelable(false) |
| .setTitle(R.string.aa_dialog_title) |
| - .setMessage(Html.fromHtml(this.readTextFile(R.raw.aa_dialog))) |
| + .setMessage(Html.fromHtml(getString(R.string.aa_dialog_message))) |
| .setNeutralButton(R.string.aa_dialog_button, new OnClickListener() |
| { |
| @Override |
| public void onClick(DialogInterface dialog, int which) |
| { |
| prefs.edit() |
| .putBoolean(keyAaInfoShown, true) |
| .commit(); |
| @@ -169,17 +169,17 @@ public class MainPreferences extends Pre |
| .getBoolean(this.getString(R.string.key_application_activated), false); |
| if (!applicationActivated) |
| { |
| Log.d(TAG, "Showing setup dialog"); |
| this.setupDialog = new AlertDialog.Builder(this) |
| .setCancelable(false) |
| .setTitle(R.string.setup_dialog_title) |
| - .setMessage(Html.fromHtml(this.readTextFile(R.raw.setup_dialog))) |
| + .setMessage(Html.fromHtml(getString(R.string.setup_dialog_message))) |
| .setNeutralButton(R.string.setup_dialog_button, new OnClickListener() |
| { |
| @Override |
| public void onClick(DialogInterface dialog, int which) |
| { |
| Engine.openSBrowserSettings(MainPreferences.this); |
| } |
| }) |
| @@ -220,37 +220,9 @@ public class MainPreferences extends Pre |
| { |
| if (this.setupDialog != null) |
| { |
| this.setupDialog.dismiss(); |
| this.setupDialog = null; |
| } |
| } |
| } |
| - |
| - private String readTextFile(int id) |
| - { |
| - try |
| - { |
| - final BufferedReader r = new BufferedReader(new InputStreamReader(this.getResources() |
| - .openRawResource(id), "UTF-8")); |
| - try |
| - { |
| - final StringBuilder sb = new StringBuilder(); |
| - for (String line = r.readLine(); line != null; line = r.readLine()) |
| - { |
| - sb.append(line); |
| - sb.append('\n'); |
| - } |
| - return sb.toString(); |
| - } |
| - finally |
| - { |
| - r.close(); |
| - } |
| - } |
| - catch (IOException e) |
| - { |
| - Log.e(TAG, "Resource reading failed for: " + id, e); |
| - return "..."; |
| - } |
| - } |
| } |