how to run another app with specific extras in android

0

Another app added to my launcher home page a shortcut to a specific feature in it. I want my app to launch directly this feature too. When I click the shortcut in my launcher it writes in the logcat:

 {act=com.xiaomi.smarthome.scene.smarthomelauncher flg=0x10000000 cmp=com.xiaomi.smarthome/.scene.SmartHomeLauncherActivity bnds=[511,1390][700,1599] (has extras)}

what I have tried and didn't work:

    PackageManager manager = context.getPackageManager();
    Intent intent = manager.getLaunchIntentForPackage("com.xiaomi.smarthome");
    intent.addCategory(Intent.CATEGORY_LAUNCHER);
    Bundle bundle = new Bundle();
    bundle.putString("act" , "com.xiaomi.smarthome.scene.smarthomelauncher");
    bundle.putString("flg" , "0x10000000");
    bundle.putString("cmp" , "com.xiaomi.smarthome/.scene.SmartHomeLauncherActivity");
    bundle.putString("bnds" , "[322,1390][511,1599]");
    intent.putExtras(bundle);
    context.startActivity(intent);

any idea?

java
android
asked on Stack Overflow Jan 13, 2019 by Gal Ep

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0