OpenLauncherTeam / openlauncher

Customizable and Open Source Launcher for Android
Apache License 2.0
1.41k stars 413 forks source link

Work profile #538

Closed hobleyd closed 4 years ago

hobleyd commented 4 years ago

All,

I have no idea whether this helps or not; the following code allows the correct icons to display and the various components of the App class match as expected.

However, while the icon displays, the launch code:

LauncherApps launcherApps = (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE); List activities = launcherApps.getActivityList(app.getPackageName(), app._userHandle); launcherApps.startMainActivity(activities.get(0).getComponentName(), app._userHandle, null, getActivityAnimationOpts(view));

opens up the wrong activity in the app. In my case, the Dialler opens up contacts instead of the dialling screen. So I thought I would submit this if it helps. Feel free to reject if it doesn't.

Happy to do more work on this, but I might need pointing in the right direction as I have no idea how to make startMainActivity to do the right thing.

Cheers, David

gsantner commented 4 years ago

Have you reproduce the issue on current master? Just want to make sure @dkanada 's recent changes aren't already fixing it

hobleyd commented 4 years ago

Yes - this was based on an up to date master at the time.

hobleyd commented 4 years ago

I should have pointed out this semi-fixes #532 as it does display the required icon; but it doesn't open to the right screen still and I'm not sure how to fix it.

gsantner commented 4 years ago

@dkanada Feedback? I wasn't involved in this at all :D

dkanada commented 4 years ago

I'll have to test it but this looks like it might fix the issue.

cmtjk commented 4 years ago

LauncherApps launcherApps = (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE); List activities = launcherApps.getActivityList(app.getPackageName(), app._userHandle); launcherApps.startMainActivity(activities.get(0).getComponentName(), app._userHandle, null, getActivityAnimationOpts(view));

opens up the wrong activity in the app. In my case, the Dialler opens up contacts instead of the dialling screen. So I thought I would submit this if it helps. Feel free to reject if it doesn't.

see https://github.com/OpenLauncherTeam/openlauncher/pull/554