Use creation context for TextClassificationManager
Reported by
ti...@chromium.org,
Apr 28 2017
|
||
Issue descriptionWe retrieve the TextClassifier from a context through TextClassificationManager: TextClassificationManager mgr = context.getSystemService(); TextClassifier classifier = mgr.getTextClassifier(); It is also possible to set a new classifire into a TextClassificationManager. Because of that it seems to make sense to use the WebView creation context when we need the text classifier in the WebView. Right now the code uses initial WindowAndroid, i.e. the Activity this WebView first appeared in. From Toki: --------------- The important thing to note is that the TextClassificationManager belongs to the particular instance of the context, and the TextClassifier you set belongs to that TextClassificationManager. i.e. Context ---has a--> TextClassificationManager ---has a--> TextClassifier My suggestion will be to use the context you're using to initialise the WebView. You also probably want to be consistent with the context(s) you're using. -------------------------
,
May 16 2017
Per discussion with Bo the WindowAndroid context which is currently used is the right one. |
||
►
Sign in to add a comment |
||
Comment 1 by ti...@chromium.org
, Apr 28 2017