How to handle activity and package changes in a single android application

I have a situation where first screen is of package A and Activity A1, Next screen package B and Activity B1.
UIAutomator viewer failed to get dom and can’t inspect elements, neither appium recognizes any elements in second screen.

I have tried driver.startActivity(packageB, activityB1); Error shows - Can’t open application.

Appreciate any suggestions / tips to resolve this.