Fragment didn't create a view fix

This commit is contained in:
Yuriy Liskov 2023-10-15 21:19:04 +03:00
parent 6c9fedb39d
commit 6448a10f73
4 changed files with 9 additions and 12 deletions

View File

@ -3232,8 +3232,10 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
}
if (fragment.mView == null) {
throw new IllegalStateException("Fragment " + fname
+ " did not create a view.");
// MOD: Fragment didn't create a view fix
return null;
//throw new IllegalStateException("Fragment " + fname
// + " did not create a view.");
}
if (id != 0) {
fragment.mView.setId(id);

View File

@ -59,8 +59,8 @@ android {
applicationId "com.liskovsoft.smarttubetv"
minSdkVersion project.properties.minSdkVersion
targetSdkVersion project.properties.targetSdkVersion
versionCode 1142
versionName "19.52"
versionCode 1143
versionName "19.53"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"
@ -76,7 +76,7 @@ android {
reset()
// Note, Android could soon start warning users when they run 32-bit apps
//include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a' //select ABIs to build APKs for
include 'x86', 'armeabi-v7a' //select ABIs to build APKs for
include 'armeabi-v7a', 'x86', 'arm64-v8a' // v7a main build, x86 for WSL, v8a for Pixel Tablet (no 32 bit support)
universalApk false //generate an additional APK that contains all the ABIs
}
}

View File

@ -26,7 +26,7 @@ public class MainApplication extends MultiDexApplication { // fix: Didn't find c
static {
// fix youtube bandwidth throttling (best - false)???
// false is better for streams (less buffering)
//System.setProperty("http.keepAlive", "false");
System.setProperty("http.keepAlive", "false");
// fix ipv6 infinite video buffering???
// Better to remove this fix at all. Users complain about infinite loading.
//System.setProperty("java.net.preferIPv6Addresses", "true");

View File

@ -10,11 +10,6 @@ public class WebBrowserActivity extends LeanbackActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
setContentView(R.layout.fragment_webbrowser);
} catch (IllegalStateException e) {
// Fragment com.liskovsoft.smartyoutubetv2.tv.ui.webbrowser.WebBrowserFragment did not create a view.
e.printStackTrace();
}
setContentView(R.layout.fragment_webbrowser);
}
}