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

Working with Flutter Fragment Activity #7

Open
BrianMwas opened this issue Jul 27, 2022 · 4 comments
Open

Working with Flutter Fragment Activity #7

BrianMwas opened this issue Jul 27, 2022 · 4 comments

Comments

@BrianMwas
Copy link

BrianMwas commented Jul 27, 2022

I am building an app that requires the use of the package but the problem is that I am using a FlutterFragment while the package uses an activity. What can I do in this case?
The code looks like this
public class MainActivity extends FlutterFragmentActivity implements GiphyDialogFragment.GifSelectionListener

@BrianMwas
Copy link
Author

What might be the solution for it?

@dtkdt100
Copy link
Owner

Hi, thanks for your report.

You can not extend two classes in Java.

I have a solution for that but it is not ideal. As mentioned in Flutter Android Error: How to extends MainActivity from "Two Packages" I will recommend to try and implement FlutterShareReceiverActivity class in your MainActivity class.

For exmaple:
In your configureFlutterEngine function, you can add a native call for "analyze" and copy all of the code in FlutterShareReceiverActivity class to there.

I am not sure if it will work perfectly but it totally deserves a try.

@BrianMwas
Copy link
Author

Any progress on this? I tried changing it from Flutter activity to FlutterFragmentActivity then extending the library but now the application does not work

@dtkdt100
Copy link
Owner

Hi,

In the meantime, I don't have the time to deal with it, but this is indeed a very important point, so I will leave the issue open and maybe other people will help.

If you manage to solve the problem, I would appreciate it if you could make a pull request.

The direction I would explore is: try and copy the entire pckage to your code and change the java code In order that the two packages will work togther.

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

No branches or pull requests

2 participants