Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help please #268

Open
myopenhab opened this issue Jun 14, 2020 · 3 comments
Open

Help please #268

myopenhab opened this issue Jun 14, 2020 · 3 comments
Labels

Comments

@myopenhab
Copy link

myopenhab commented Jun 14, 2020

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);
}
}

}

@mhemon
Copy link

mhemon commented Dec 19, 2020

Same problem, did you find any solution?

@ocram ocram added the question label Dec 30, 2020
@ocram
Copy link
Contributor

ocram commented Dec 30, 2020

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
Copy link
Contributor

ocram commented Dec 30, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants