Skip to content

Instantly share code, notes, and snippets.

View niharika2810's full-sized avatar
💭
Happy with what I am, but not yet satisfied :-)

Niharika Arora niharika2810

💭
Happy with what I am, but not yet satisfied :-)
View GitHub Profile
@Before
public static void setup() {
RxAndroidPlugins.setInitMainThreadSchedulerHandler(
__ -> Schedulers.trampoline());
}
<TextView
android:id="@+id/name"
android:minWidth="50dp"
android:background="@drawable/dynamic_data_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
private void resetMinWidth(TextView textView)
{
textView.setMinWidth(0);
}
@niharika2810
niharika2810 / gist.txt
Last active May 30, 2020 20:10
No WebView Installed.
Caused by android.util.AndroidRuntimeException:
android.webkit.WebViewFactory$MissingWebViewPackageException:
Failed to load WebView provider: No WebView installed
at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:371)
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:194)
at android.webkit.WebView.getFactory(WebView.java:2325)
at android.webkit.WebView.ensureProviderCreated(WebView.java:2320)
at android.webkit.WebView.setOverScrollMode(WebView.java:2379)
at android.view.View.<init>(View.java:4371)
at android.view.View.<init>(View.java:4519)
try {
// the inflating code that's causing the crash
} catch (Exception e) {
if (e.getMessage() != null && e.getMessage().contains("webview")) {
// If the system failed to inflate this view because of the WebView (which could
// be one of several types of exceptions), it likely means that the system WebView
// is either not present (unlikely) OR in the process of being updated (also unlikely).
// It's unlikely but we have been receiving a lot of crashes.
// In this case, show the user a message and finish the activity
Fatal Exception: android.view.WindowManager$BadTokenException
Unable to add window -- token android.os.BinderProxy@f839de9 is not valid; is your activity running?
android.view.ViewRootImpl.setView (ViewRootImpl.java:697)
android.view.WindowManagerGlobal.addView (WindowManagerGlobal.java:347)
android.view.WindowManagerImpl.addView (WindowManagerImpl.java:94)
android.widget.Toast$TN.handleShow (Toast.java:463)
android.widget.Toast$TN$2.handleMessage (Toast.java:346)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:163)
android.app.ActivityThread.main (ActivityThread.java:6377)
implementation 'com.toastfix:toastcompatwrapper:0.0.2'
ToastHandler.getINSTANCE().showToast(this, "Hello,I am Toast", Toast.LENGTH_SHORT);
implementation 'com.toastfix:toastcompatwrapper:0.0.2'
ToastHandler.INSTANCE.showToast(this, "Hi,I am Toast", Toast.LENGTH_LONG)