Git Product home page Git Product logo

Comments (5)

ducviet321 avatar ducviet321 commented on July 20, 2024 1

Yeah it was my typo, maybe be you should rename intent variable instead of removing it, I haven't looked, just try to make it work quickly

from flutter_overlay_window.

macdo-py avatar macdo-py commented on July 20, 2024

Hi @ducviet321 , Im very interested in your idea / implementation, could not make it work, could you please explain a little more.
The file you are referencing is: OverlayService.java?
In wich line did you add your code?
Do you need to do something else beside calling it as you said?

Thanks in advance!

from flutter_overlay_window.

ducviet321 avatar ducviet321 commented on July 20, 2024

@macdo-py First you need to find your app namespace (maybe in android/app/src/main/kotlin/com/example/myapp/MainActivity.kt)

In /lib/src/overlay_window.dart add to class FlutterOverlayWindow

static Future<bool?> openMainApp() async {
    final bool? _res = await _overlayChannel.invokeMethod<bool?>('openMainApp');
    return _res;
  }

in android/src/main/java/flutter/overlay/window/flutter_overlay_window/OverlayService.java

Find flutterChannel.setMethodCallHandler((call, result) -> { and add below

            } else if (call.method.equals("resizeOverlay")) {
               ...
            } else if (call.method.equals("openMainApp")) {
                Intent intent = new Intent();
                intent.setClassName("com.vitinc. myapp", "com.vitinc.myapp.MainActivity");
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivity(intent);
            }

from flutter_overlay_window.

macdo-py avatar macdo-py commented on July 20, 2024

@ducviet321 thank you so much for your help!!! it worked but I hag to remove the line
Intent intent = new Intent();
And also, I'd like to know why you added a space in your app namespace, was it a typo o it should be like that.

Thanks again and best regards!

from flutter_overlay_window.

icanall10 avatar icanall10 commented on July 20, 2024

use https://pub.dev/packages/android_intent_plus with app links

from flutter_overlay_window.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.