mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Android: Fixed a bug which caused android native dialogs to be presented multiple times in a row
This commit is contained in:
parent
c666381ef9
commit
9d5b41e212
1 changed files with 4 additions and 2 deletions
|
|
@ -650,8 +650,9 @@ public:
|
|||
|
||||
void onStart() override
|
||||
{
|
||||
getEnv()->CallVoidMethod (getNativeHandle(), AndroidFragment.startActivityForResult,
|
||||
intent.get(), requestCode);
|
||||
if (! std::exchange (activityHasStarted, true))
|
||||
getEnv()->CallVoidMethod (getNativeHandle(), AndroidFragment.startActivityForResult,
|
||||
intent.get(), requestCode);
|
||||
}
|
||||
|
||||
void onActivityResult (int activityRequestCode, int resultCode, LocalRef<jobject> data) override
|
||||
|
|
@ -667,6 +668,7 @@ private:
|
|||
GlobalRef intent;
|
||||
int requestCode;
|
||||
std::function<void (int, int, LocalRef<jobject>)> callback;
|
||||
bool activityHasStarted = false;
|
||||
};
|
||||
|
||||
void startAndroidActivityForResult (const LocalRef<jobject>& intent, int requestCode,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue