我想知道是否有其他方法可以切换到不同的应用程序?内置的任务切换器不会导致精灵宝可梦Go重启。有没有办法调用它?
我一直在用它从我的应用程序切换到打开Pokemon Go
PackageManager manager = context.getPackageManager();
Intent intent = manager.getLaunchIntentForPackage("com.nianticlabs.pokemongo");
intent.addCategory(Intent.CATEGORY_LAUNCHER);几个月前,这启动了精灵宝可梦Go的黑屏。解决这个问题的办法是关闭精灵宝可梦go,然后通过我的应用程序切换到它来启动精灵宝可梦Go。第一次会像预期的那样从精灵宝可梦Go的加载屏幕开始,但之后会正确地在应用程序之间切换。
最新版本的Pokemon Go似乎已经修复了黑屏问题,每次切换到Pokemon Go时都会重新启动它。我在他们的AndroidManifest.xml中发现了另一个意图过滤器,它起作用了,但它也会导致应用程序重启。
Uri uri = Uri.parse("http://pokemongolive.com/launchapp");
Intent pokemonGoIntent = new Intent(Intent.ACTION_VIEW, uri);
if (pokemonGoIntent.resolveActivity(getPackageManager()) != null)
startActivity(pokemonGoIntent);是切换到其他应用程序的另一种方式吗?即使当我的应用程序加载并运行时,内置的任务切换器也不会导致Pokemon Go重启。
https://stackoverflow.com/questions/47671773
复制相似问题