FORUMS

SDK

SDK

ForumsSDK
How to listen swap screen event, show main on dual screen event start and finish on LG Dual Screen
dangquanuet

● SDK Type: Dual Screen SDK

How to listen swap screen event, show main on dual screen event start and finish on LG Dual Screen?
Posted on 26-Feb-2020
alsu4r

Re:How to listen swap screen event, show main on dual screen event start and finish on LG Dual Screen

Dear dangguanuet

I'm sorry I cannot understand clearly your question on my end.
Swap event, you can get it if you overwrite onMovedToDisplay which is child class of View.java

Please give me further information more detail, if I misunderstood your question or you have another question.


Posted on 26-Feb-2020
dangquanuet

Re:How to listen swap screen event, show main on dual screen event start and finish on LG Dual Screen

Thank for replying
I want to know when user click on swap screen button and when swapping screen is finished
And I do not find onMovedToDisplay


Posted on 26-Feb-2020
alsu4r

Re:How to listen swap screen event, show main on dual screen event start and finish on LG Dual Screen

That is not public api so you may not found.
But you can find onMovedToDisplay method in View.java code
Method is going to call after moving View.

I just attach link from google git repository about P-OS
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/pie-release/core/java/android/view/View.java#17932


17932 public void onMovedToDisplay(int displayId, Configuration config) {
17933 }


Posted on 26-Feb-2020
dangquanuet

Re:How to listen swap screen event, show main on dual screen event start and finish on LG Dual Screen

Yeah, it works, thank you so much :)


Posted on 26-Feb-2020