Commit 0f2135e9963d5c062a15fa5bd5218a489290e811
1 parent
715b9bcb
Selector de qualitat ben fet
Showing
4 changed files
with
6 additions
and
4 deletions
res/values/strings.xml
... | ... | @@ -42,5 +42,6 @@ |
42 | 42 | </string-array> |
43 | 43 | <string name="selectorTitle">Qualitat inicial</string> |
44 | 44 | <string name="selectorSummary">Sel·lecciona la qualitat inicial de reproducció</string> |
45 | + <string name="defaultQuality">0</string> | |
45 | 46 | |
46 | 47 | </resources> |
47 | 48 | \ No newline at end of file | ... | ... |
res/xml/prefs.xml
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" > |
3 | 3 | <EditTextPreference android:key="server" android:title="@string/url" android:summary="@string/urlhint" android:defaultValue="@string/defaultURL"/> |
4 | - <ListPreference android:key="selector" android:dialogTitle="@string/selectorTitle" android:entries="@array/selectorEntries" android:dialogMessage="@string/selectorSummary" android:entryValues="@array/selectorValues" android:title="@string/selectorTitle" android:summary="@string/selectorSummary"/> | |
5 | - </PreferenceScreen> | |
6 | 4 | \ No newline at end of file |
5 | + <ListPreference android:key="selector" android:entries="@array/selectorEntries" android:entryValues="@array/selectorValues" android:title="@string/selectorTitle" android:summary="@string/selectorSummary" android:defaultValue="@string/defaultQuality"/> | |
6 | + | |
7 | + </PreferenceScreen> | ... | ... |
src/com/upc/pbe/upcnews/HLS.java
src/com/upc/pbe/upcnews/UpcApp.java
... | ... | @@ -20,7 +20,7 @@ public class UpcApp extends Application implements |
20 | 20 | private int quality; |
21 | 21 | |
22 | 22 | public int getQuality(){ |
23 | - quality = (int) prefs.getLong("selector", 0); | |
23 | + quality = (int) Integer.parseInt(prefs.getString("selector", "0")); | |
24 | 24 | return quality; |
25 | 25 | } |
26 | 26 | ... | ... |