0

I dont know, what causing this error to my code, which preventing to display the webpage inside my app. Any help will be appreciable.

Error:

W/WindowManager: Failed looking up window
java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@53888cdc does not exist
    at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7640)
    at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7631)
    at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:854)
    at android.os.BinderProxy.sendDeathNotice(Binder.java:449)
    at dalvik.system.NativeStart.run(Native Method)
03-06 03:05:14.302 317-1095/? I/WindowState: WIN DEATH: null

Inside MainActivity:

public void openJS(){
    emi_btn = (Button)findViewById(R.id.emibtnid);

    emi_btn.setOnClickListener(
            new View.OnClickListener() {
                @Override
                public void onClick(View v) {

                    String url = "http://192.168.207.50/emi/emicalc.html";
                    WebView view = (WebView)findViewById(R.id.webView);
                    view.getSettings().setJavaScriptEnabled(true);
                    view.loadUrl(url);

                  /*  Intent intent = new Intent("com.example.amul.loginapp.EmiCalculator");
                    startActivity(intent);*/


                }
            }


    );

Inside XML:

    <WebView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/webView"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true" />

Inside AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />


 <activity
        android:name=".EmiCalculator"
        android:label="@string/title_activity_emi_calculator"
        android:theme="@style/AppTheme.NoActionBar">

        <intent-filter>
            <action android:name="com.example.amul.loginapp.EmiCalculator" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>

    </activity>

After updating the Virtual Device to GoogleNexus 6P - 6.00 API23, I got below error:

W/EGL_emulation: eglSurfaceAttrib not implemented
03-06 00:46:53.599 2203-2216/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xeea53560, error=EGL_SUCCESS
03-06 00:46:53.681 812-831/? W/WindowAnimator: Failed to dispatch window animation state change.
                                               android.os.DeadObjectException
                                                   at android.os.BinderProxy.transactNative(Native Method)
                                                   at android.os.BinderProxy.transact(Binder.java:503)
                                                   at android.view.IWindow$Stub$Proxy.onAnimationStopped(IWindow.java:534)
                                                   at com.android.server.wm.WindowAnimator.updateWindowsLocked(WindowAnimator.java:286)
                                                   at com.android.server.wm.WindowAnimator.animateLocked(WindowAnimator.java:678)
                                                   at com.android.server.wm.WindowAnimator.-wrap0(WindowAnimator.java)
                                                   at com.android.server.wm.WindowAnimator$1.doFrame(WindowAnimator.java:123)
                                                   at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856)
                                                   at android.view.Choreographer.doCallbacks(Choreographer.java:670)
                                                   at android.view.Choreographer.doFrame(Choreographer.java:603)
                                                   at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
                                                   at android.os.Handler.handleCallback(Handler.java:739)
                                                   at android.os.Handler.dispatchMessage(Handler.java:95)
                                                   at android.os.Looper.loop(Looper.java:148)
                                                   at android.os.HandlerThread.run(HandlerThread.java:61)
                                                   at com.android.server.ServiceThread.run(ServiceThread.java:46)

Just to put my answer so that if anyone landed over this page - I re-coded everything in new activity with a fresh project, it was working fine. the thing you have to take care is the IP / localhost / (incase of different virtual devices like Google AVD, Genymotion, android IP address, etc) . Not required to change AVD API or other things.. anyways thanks for their support –

林果皞
  • 7,539
  • 3
  • 55
  • 70
Amul Bhatia
  • 154
  • 1
  • 11
  • 1
    It seems like you're asking for the system a feature the device does not support - as seen here (http://stackoverflow.com/questions/13396088/what-does-exception-java-lang-illegalargumentexception-requested-window-android)- or you are having memory usage problems, as seen here (http://stackoverflow.com/questions/10219146/failed-looking-up-window-different-behaviors-from-same-app-on-2-galaxy-nexus) – rafaelc Mar 06 '16 at 03:38
  • I'll check, can you advise which version of android does webview support ?? – Amul Bhatia Mar 06 '16 at 03:49
  • Just to put my answer so that if anyone landed over this page - I re-coded everything in new activity with a fresh project, it was working fine. the thing you have to take care is the IP / localhost / (incase of different virtual devices like Google AVD, Genymotion, android IP address, etc) . Not required to change AVD API or other things.. anyways thanks for their support – Amul Bhatia Mar 07 '16 at 09:31

2 Answers2

0

This is because your activity dies. Go to Settings > Developer Options, there is a check box called "Don't keep activities" "Destroy every activity as soon as the user leaves it". Just unchecked it the check..

Alternatively, This may be caused by calling a system API that is not available on your target device or your manufacturing device missing them...

Attiq ur Rehman
  • 475
  • 1
  • 6
  • 21
0

avd manager->emulated performance->turn on "Use Host GPU" works for me.