Fixed nullpointer exception in webview loader
This commit is contained in:
parent
35e65efb18
commit
3692119bed
|
@ -228,16 +228,21 @@ public class ItemDescriptionFragment extends SherlockFragment {
|
||||||
} else {
|
} else {
|
||||||
data = StringEscapeUtils.unescapeHtml4(contentEncodedRef);
|
data = StringEscapeUtils.unescapeHtml4(contentEncodedRef);
|
||||||
}
|
}
|
||||||
|
Activity activity = getActivity();
|
||||||
TypedArray res = getActivity().getTheme()
|
if (activity != null) {
|
||||||
.obtainStyledAttributes(
|
TypedArray res = getActivity()
|
||||||
new int[] { android.R.attr.textColorPrimary });
|
.getTheme()
|
||||||
int colorResource = res.getColor(0, 0);
|
.obtainStyledAttributes(
|
||||||
String colorString = String.format("#%06X",
|
new int[] { android.R.attr.textColorPrimary });
|
||||||
0xFFFFFF & colorResource);
|
int colorResource = res.getColor(0, 0);
|
||||||
Log.i(TAG, "text color: " + colorString);
|
String colorString = String.format("#%06X",
|
||||||
res.recycle();
|
0xFFFFFF & colorResource);
|
||||||
data = getWebViewStyle(colorString) + data;
|
Log.i(TAG, "text color: " + colorString);
|
||||||
|
res.recycle();
|
||||||
|
data = getWebViewStyle(colorString) + data;
|
||||||
|
} else {
|
||||||
|
cancel(true);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue