[Android] Use getRessources in About
Jean-Baptiste Kempf
git at videolan.org
Mon Jun 25 15:46:24 CEST 2012
android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Jun 25 15:20:22 2012 +0200| [d6903e8813a767aa2ad9c5bb8e984137b98b268c] | committer: Jean-Baptiste Kempf
Use getRessources in About
> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=d6903e8813a767aa2ad9c5bb8e984137b98b268c
---
vlc-android/src/org/videolan/vlc/Util.java | 4 ++--
vlc-android/src/org/videolan/vlc/gui/AboutLicenceFragment.java | 4 ++--
vlc-android/src/org/videolan/vlc/gui/AboutMainFragment.java | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/Util.java b/vlc-android/src/org/videolan/vlc/Util.java
index 9d7063b..1e7573c 100644
--- a/vlc-android/src/org/videolan/vlc/Util.java
+++ b/vlc-android/src/org/videolan/vlc/Util.java
@@ -72,9 +72,9 @@ public class Util {
return s;
}
- public static String readAsset(Context ctx, String assetName, String defaultS) {
+ public static String readAsset(String assetName, String defaultS) {
try {
- InputStream is = ctx.getResources().getAssets().open(assetName);
+ InputStream is = VLCApplication.getAppResources().getAssets().open(assetName);
BufferedReader r = new BufferedReader(new InputStreamReader(is, "UTF8"));
StringBuilder sb = new StringBuilder();
String line = r.readLine();
diff --git a/vlc-android/src/org/videolan/vlc/gui/AboutLicenceFragment.java b/vlc-android/src/org/videolan/vlc/gui/AboutLicenceFragment.java
index 0d1ea8d..7175b80 100644
--- a/vlc-android/src/org/videolan/vlc/gui/AboutLicenceFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/AboutLicenceFragment.java
@@ -43,9 +43,9 @@ public class AboutLicenceFragment extends Fragment {
{
super.onCreateView(inflater, container, savedInstanceState);
View v = inflater.inflate(R.layout.about_licence, container, false);
- String revision = Util.readAsset(getActivity(), "revision.txt", "Unknown revision");
+ String revision = Util.readAsset("revision.txt", "Unknown revision");
WebView t = (WebView)v.findViewById(R.id.webview);
- t.loadData(Util.readAsset(getActivity(), "licence.htm", "").replace("!COMMITID!",revision), "text/html", "UTF8");
+ t.loadData(Util.readAsset("licence.htm", "").replace("!COMMITID!",revision), "text/html", "UTF8");
return v;
}
}
\ No newline at end of file
diff --git a/vlc-android/src/org/videolan/vlc/gui/AboutMainFragment.java b/vlc-android/src/org/videolan/vlc/gui/AboutMainFragment.java
index 4d37911..749f619 100644
--- a/vlc-android/src/org/videolan/vlc/gui/AboutMainFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/AboutMainFragment.java
@@ -46,8 +46,8 @@ public class AboutMainFragment extends Fragment {
TextView link = (TextView) v.findViewById(R.id.main_link);
link.setText(Html.fromHtml(this.getString(R.string.about_link)));
- String builddate = Util.readAsset(getActivity(), "builddate.txt", "Unknown");
- String builder = Util.readAsset(getActivity(), "builder.txt", "unknown");
+ String builddate = Util.readAsset("builddate.txt", "Unknown");
+ String builder = Util.readAsset("builder.txt", "unknown");
TextView compiled = (TextView) v.findViewById(R.id.main_compiled);
compiled.setText(builder + " (" + builddate + ")");
More information about the Android
mailing list