From 1dd697f091dfcf9ae225e921323b045ec6de0b0e Mon Sep 17 00:00:00 2001 From: m0viefreak Date: Tue, 5 Feb 2013 20:46:56 +0100 Subject: [PATCH] MessageView: fix crash when clicking on URLs in WebView The ContextThemeWrapper added in a74d57cb71d67e42e1db709e00d5fd514b1ecd0c 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. --- src/com/fsck/k9/fragment/MessageViewFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/fsck/k9/fragment/MessageViewFragment.java b/src/com/fsck/k9/fragment/MessageViewFragment.java index a8fcfaadc..51f5723c3 100644 --- a/src/com/fsck/k9/fragment/MessageViewFragment.java +++ b/src/com/fsck/k9/fragment/MessageViewFragment.java @@ -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);