New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android: Disallow multiple launcher activities #8860
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there a cleaner way to know if the activity's launching/running rather than adding another static?
Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java
Outdated
Show resolved
Hide resolved
Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java
Outdated
Show resolved
Hide resolved
|
@Tilka (I think you were flacs from IRC) After the IRC discussion, I looked at the code again. I think launch() and launchfile() are actually called from the same thread. Those methods eventually trigger @sepalani I looked into a few options to see if I could detect if the NativeEmulation thread is already running. |
578a3ec
to
86b75f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that from what I read, the boolean variable is the only/simplest method so far to prevent an event from firing twice. Even disabling the element won't work as multiple events can be in the queue and will be handled before disabling it.
Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java
Outdated
Show resolved
Hide resolved
Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java
Outdated
Show resolved
Hide resolved
|
@sepalani Good to hear we found the same thing on using a boolean here. Is the new variable naming scheme acceptable now? |
|
@Ebola16 The naming is better, IMO. You just need to rename The other alternative I found regarding this issue is using a lock (mutex) but I'm not well versed in Android to know if it's the Android-way of handling this. |
Fixes https://bugs.dolphin-emu.org/issues/11935