Android-AdvancedWebView icon indicating copy to clipboard operation
Android-AdvancedWebView copied to clipboard

Help please

Open myopenhab opened this issue 4 years ago • 3 comments

I have implemented the code in my project and it opens an advanced WebView 'web view' but I am struggling with the setlistener method returning the path to an image back to the webview.

Where would I place this code in an Androidx, nav drawer, fragment with 'view model' Kotlin project?

The project advises: Add the following code to the parent FragmentActivity in order to forward the results from the FragmentActivity to the appropriate Fragment instance-

public class MyActivity extends FragmentActivity implements AdvancedWebView.Listener {

@Override public void onActivityResult(int requestCode, int resultCode, Intent intent) { super.onActivityResult(requestCode, resultCode, intent); if (mFragment != null) { mFragment.onActivityResult(requestCode, resultCode, intent); } }

}

myopenhab avatar Jun 14 '20 09:06 myopenhab

Same problem, did you find any solution?

mhemon avatar Dec 19 '20 18:12 mhemon

You certainly need to implement the onActivityResult method somewhere to make file uploads work.

Your Activity or Fragment should have such a method named onActivityResult available to override. Please debug (e.g. by logging or printing some messages) whether that method is actually called (during an upload).

ocram avatar Dec 30 '20 11:12 ocram

Perhaps you might also find this helpful:

https://stackoverflow.com/questions/6147884/onactivityresult-is-not-being-called-in-fragment

ocram avatar Dec 30 '20 11:12 ocram