1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

MessageView: fix crash when clicking on URLs in WebView

The ContextThemeWrapper added in a74d57cb71
used getActivity().getApplicationContext() to get the base context.
This is wrong, because an Application context won't work for starting
activities from the WebView.

Instead, use the context that is given to us in the constructor as base
context. This is the one that would also  be used if no ContextThemeWrapper
was present at all.
This commit is contained in:
m0viefreak 2013-02-05 20:46:56 +01:00 committed by cketti
parent 5fa7e65816
commit 1dd697f091

View File

@ -171,7 +171,7 @@ public class MessageViewFragment extends SherlockFragment implements OnClickList
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Context context = new ContextThemeWrapper(getActivity().getApplicationContext(),
Context context = new ContextThemeWrapper(inflater.getContext(),
K9.getK9ThemeResourceId(K9.getK9MessageViewTheme()));
mLayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = mLayoutInflater.inflate(R.layout.message, container, false);