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

ActivityOptions setLaunchDisplayId not working #29

Closed
trickymagus opened this issue May 1, 2023 · 1 comment
Closed

ActivityOptions setLaunchDisplayId not working #29

trickymagus opened this issue May 1, 2023 · 1 comment

Comments

@trickymagus
Copy link

trickymagus commented May 1, 2023

    public static int startActivity(Intent intent, int userId) {
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
            intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK);
            ActivityOptions options = ActivityOptions.makeBasic().setLaunchDisplayId(65);

            return (int) Cmd.INSTANCE().exec(
                    CmdConstants.CMD_START_ACTIVITY,
                    intent,
                    options.toBundle(),
                    userId
            );
        } else {
            return (int) Cmd.INSTANCE().exec(
                    CmdConstants.CMD_START_ACTIVITY,
                    intent,
                    null,
                    userId
            );
        }
    }

I changed startActivity in opensdk/HackApi.java to test setLaunchDisplayId working.
But application always starts in main display, not secondary display.
In the developer options, you can enable the 'simulate secondary display' option and obtain the displayId to test this code.

@WaxMoon
Copy link
Owner

WaxMoon commented May 21, 2023

plz test latest opensdk

@WaxMoon WaxMoon closed this as completed Jun 5, 2023
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