Fixed
Status Update
Comments
da...@google.com <da...@google.com>
ph...@gmail.com <ph...@gmail.com> #3
We're still trying to work out if we can work around this in the library.
In the mean-time, if you know that you are going to create a WebView in an Activity, you can do the following:
protected void onCreate(Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= 24) {
new WebView(this);
}
super.onCreate(savedInstanceState);
}
In the mean-time, if you know that you are going to create a WebView in an Activity, you can do the following:
protected void onCreate(Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= 24) {
new WebView(this);
}
super.onCreate(savedInstanceState);
}
da...@google.com <da...@google.com> #4
alternatively you were able to get it to work by capturing the configuration prior to inflating a webview and restoring it after
Configuration oldConfig = getCurrentConfig();
//**inflate webview here**
restoreConfig(oldConfig);
Configuration getCurrentConfig() {
return new Configuration(activity.getResources().getConfiguration());
}
void restoreConfig(@Nullable Configuration configuration) {
//if the config isn't null, a webview was inflated and we should update the configuration to
//the previous one to prevent nightmode from being reset by webview inflation
if (configuration != null) {
activity.getResources().updateConfiguration(configuration, null);
}
}
Configuration oldConfig = getCurrentConfig();
//**inflate webview here**
restoreConfig(oldConfig);
Configuration getCurrentConfig() {
return new Configuration(activity.getResources().getConfiguration());
}
void restoreConfig(@Nullable Configuration configuration) {
//if the config isn't null, a webview was inflated and we should update the configuration to
//the previous one to prevent nightmode from being reset by webview inflation
if (configuration != null) {
activity.getResources().updateConfiguration(configuration, null);
}
}
cm...@gmail.com <cm...@gmail.com> #5
#3: That can work, but you don't want to do that on EVERY WebView inflate, only the first. My workaround is #2 is a one-time call.
Description
@Insert
fun addBook(book: Book) : Completable
we should expand this support for prepared queries:
@Query("INSERT INTO BOOK (id, name) VALUES (1, 'A Song of Ice and Fire')")
fun addAwesomeBook() : Completable