Unable to set app to background using runAppBackGround() method in appium 1.6.4 for native android apps

I am getting an error while setting app to run in back ground using runAppBackground() method in appium 1.6.4 for android native apps, but this method working fine for appium 1.6.3.

try to ignore error. it happens. i am using for example:

try {driver.runAppInBackground(Duration.ofSeconds(1));} catch (Exception e) {}

Don’t we have the permanent solution for this in appium 1.6.4 apart from igonring the exception.

Issue: app is setting to background for with delay time and coming to foreground once delay time is over and also throwing the exception.

in mine case this was due to Appium waiting to appear wrong activity.