delight-im / Android-AdvancedWebView

Enhanced WebView component for Android that works as intended out of the box
MIT License
2.39k stars 574 forks source link

upload image just can pickup once, second choice image will ANR #230

Closed dosoos closed 5 years ago

dosoos commented 5 years ago

i use this AdvancedWebView is all fine, just have a problem is just can upload one picture, if again pickup other picture will ANR(application Not Response), i want know why? origin webview still have this problem. aaaaaaa~

ocram commented 5 years ago

It may be specific to a certain Android version or Chrome version. Other than that, if the original WebView has the same problems, there’s probably not much we can do. Sorry!

mustafaozhan commented 5 years ago

Hello I know it is closed but @dosoos I had the same issue and I want to ask you that did you try to add something like this to your Activity which has the Fragment uses AdvancedWebView

public override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {
        super.onActivityResult(requestCode, resultCode, intent)
        supportFragmentManager?.findFragmentByTag(MainFragment.TAG)?.let {
            if (it.isVisible) {
                it.onActivityResult(requestCode, resultCode, intent)
            }
        }
    }

plus you should have in your Fragment

    override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {
        super.onActivityResult(requestCode, resultCode, intent)
        webView.onActivityResult(requestCode, resultCode, intent)
    }

Then hopefully it will be fixed.

sobujbd commented 4 years ago

This will works,

@Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        advancedWebView.onActivityResult(requestCode, resultCode, data);
    }