Questions tagged [mutable-context-wrapper]

Questions related to the MutableContextWrapper object.

6 questions
9
votes
1 answer

What is the difference when I create an Android WebView object with a ContextWrapper and a Context?

Problem : I want to pre load a web page inside an Android WebView and attach it to an Activity when the Activity is ready. The trigger point of loading the webpage is before the actual Activity gets created. So I create a webview object in a service…
4
votes
1 answer

Android - How can I Attach a WebView to an Activity after creating it with the Application Context

I am creating an Android WebView in the background using the Application Context so that it is loaded and ready when I need to display it. I attach it to my Activity using addView when it is needed. This mostly works great, however when I try to…
BenV
  • 1,196
  • 1
  • 12
  • 19
1
vote
0 answers

Custom view with MutableContextWrapper VS fragments

I want to use 1 view instance in multiple activities. (Ignore the reason please) I am curious about the advantages and disadvantages of the following choices: MutableContextWrapper for the Custom View (for example: RelativeLayout) and switching…
frankish
  • 6,738
  • 9
  • 49
  • 100
1
vote
1 answer

How safe is MutableContextWrapper

How safe is the Android's MutableContextWrapper to use in terms of memory leak etc? I am instantiating a WebView with an Activity's context and later want to change its context to another Activity. Here is an answer that warns of using…
Diffy
  • 2,339
  • 3
  • 25
  • 47
1
vote
0 answers

The WebView does not refresh properly when it is passed from an Activity to another

I needed to pass a WebView to another Activity, and I couldn't create a new WebView in the new Activity because the html content can not be loaded twice. So I managed to solve the problem using a static blackboard and the MutableContextWrapper. The…
0
votes
1 answer

How to use a LayoutInflater to inflate a layout with views pointing to a MutableContextWrapper?

I have a complex "floating view" hierarchy that I am moving between different activities. As these views are shared across activities, they should all have a MutableContextWrapper that will allow them to change the base context. In theory I can have…