android - Force instrumented activity run in multi-window mode -


as know, android provided multi-window support mode in android n. our application has multi-window support.
how test it? how force test run app in mode? haven't founded such method in instrumentation class or anywhere else in documentation. maybe somehow possible espresso?

from launch new activities in multi-window mode:

when launch new activity, can hint system new activity should displayed adjacent current one, if possible. this, use intent flag flag_activity_launch_adjacent.

from docs of intent.flag_activity_launch_adjacent:

this flag used in split-screen multi-window mode. new activity displayed adjacent 1 launching it. can used in conjunction flag_activity_new_task. also, setting flag_activity_multiple_task required if want new instance of existing activity created.

as shown here how start activity under test:

@test public void customintenttostartactivity() {     intent intent = new intent(intent.flag_activity_launch_adjacent)                  | intent.flag_activity_new_task);     mactivity = mactivityrule.launchactivity(intent); } 

note, guess based on documentation, haven't tried it. although, seems me have start "fake" activity first, , there launch tested activity in multi-window mode, because "the new activity displayed adjacent the 1 launching it", there should activity launches specified intent flags.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -