Skip to content
Permalink
Browse files

Android: Added some missing activity lifecycle callbacks for Android Q

  • Loading branch information...
ed95 committed Aug 14, 2019
1 parent 164aac7 commit be8a568747854b3263b22a6996938009d09dbcff
@@ -418,13 +418,27 @@ jobject ActivityLifecycleCallbacks::invoke (jobject proxy, jobject method, jobje
auto activity = env->GetArrayLength (args) > 0 ? env->GetObjectArrayElement (args, 0) : (jobject) nullptr;
auto bundle = env->GetArrayLength (args) > 1 ? env->GetObjectArrayElement (args, 1) : (jobject) nullptr;

if (methodName == "onActivityCreated") { onActivityCreated (activity, bundle); return nullptr; }
else if (methodName == "onActivityDestroyed") { onActivityDestroyed (activity); return nullptr; }
else if (methodName == "onActivityPaused") { onActivityPaused (activity); return nullptr; }
else if (methodName == "onActivityResumed") { onActivityResumed (activity); return nullptr; }
else if (methodName == "onActivitySaveInstanceState") { onActivitySaveInstanceState (activity, bundle); return nullptr; }
else if (methodName == "onActivityStarted") { onActivityStarted (activity); return nullptr; }
else if (methodName == "onActivityStopped") { onActivityStopped (activity); return nullptr; }
if (methodName == "onActivityPreCreated") { onActivityPreCreated (activity, bundle); return nullptr; }
else if (methodName == "onActivityPreDestroyed") { onActivityPreDestroyed (activity); return nullptr; }
else if (methodName == "onActivityPrePaused") { onActivityPrePaused (activity); return nullptr; }
else if (methodName == "onActivityPreResumed") { onActivityPreResumed (activity); return nullptr; }
else if (methodName == "onActivityPreSaveInstanceState") { onActivityPreSaveInstanceState (activity, bundle); return nullptr; }
else if (methodName == "onActivityPreStarted") { onActivityPreStarted (activity); return nullptr; }
else if (methodName == "onActivityPreStopped") { onActivityPreStopped (activity); return nullptr; }
else if (methodName == "onActivityCreated") { onActivityCreated (activity, bundle); return nullptr; }
else if (methodName == "onActivityDestroyed") { onActivityDestroyed (activity); return nullptr; }
else if (methodName == "onActivityPaused") { onActivityPaused (activity); return nullptr; }
else if (methodName == "onActivityResumed") { onActivityResumed (activity); return nullptr; }
else if (methodName == "onActivitySaveInstanceState") { onActivitySaveInstanceState (activity, bundle); return nullptr; }
else if (methodName == "onActivityStarted") { onActivityStarted (activity); return nullptr; }
else if (methodName == "onActivityStopped") { onActivityStopped (activity); return nullptr; }
else if (methodName == "onActivityPostCreated") { onActivityPostCreated (activity, bundle); return nullptr; }
else if (methodName == "onActivityPostDestroyed") { onActivityPostDestroyed (activity); return nullptr; }
else if (methodName == "onActivityPostPaused") { onActivityPostPaused (activity); return nullptr; }
else if (methodName == "onActivityPostResumed") { onActivityPostResumed (activity); return nullptr; }
else if (methodName == "onActivityPostSaveInstanceState") { onActivityPostSaveInstanceState (activity, bundle); return nullptr; }
else if (methodName == "onActivityPostStarted") { onActivityPostStarted (activity); return nullptr; }
else if (methodName == "onActivityPostStopped") { onActivityPostStopped (activity); return nullptr; }

return AndroidInterfaceImplementer::invoke (proxy, method, args);
}
@@ -875,13 +875,29 @@ LocalRef<jobject> CreateJavaInterface (AndroidInterfaceImplementer* implementer,
class ActivityLifecycleCallbacks : public AndroidInterfaceImplementer
{
public:
virtual void onActivityCreated (jobject /*activity*/, jobject /*bundle*/) {}
virtual void onActivityDestroyed (jobject /*activity*/) {}
virtual void onActivityPaused (jobject /*activity*/) {}
virtual void onActivityResumed (jobject /*activity*/) {}
virtual void onActivitySaveInstanceState (jobject /*activity*/, jobject /*bundle*/) {}
virtual void onActivityStarted (jobject /*activity*/) {}
virtual void onActivityStopped (jobject /*activity*/) {}
virtual void onActivityPreCreated (jobject /*activity*/, jobject /*bundle*/) {}
virtual void onActivityPreDestroyed (jobject /*activity*/) {}
virtual void onActivityPrePaused (jobject /*activity*/) {}
virtual void onActivityPreResumed (jobject /*activity*/) {}
virtual void onActivityPreSaveInstanceState (jobject /*activity*/, jobject /*bundle*/) {}
virtual void onActivityPreStarted (jobject /*activity*/) {}
virtual void onActivityPreStopped (jobject /*activity*/) {}

virtual void onActivityCreated (jobject /*activity*/, jobject /*bundle*/) {}
virtual void onActivityDestroyed (jobject /*activity*/) {}
virtual void onActivityPaused (jobject /*activity*/) {}
virtual void onActivityResumed (jobject /*activity*/) {}
virtual void onActivitySaveInstanceState (jobject /*activity*/, jobject /*bundle*/) {}
virtual void onActivityStarted (jobject /*activity*/) {}
virtual void onActivityStopped (jobject /*activity*/) {}

virtual void onActivityPostCreated (jobject /*activity*/, jobject /*bundle*/) {}
virtual void onActivityPostDestroyed (jobject /*activity*/) {}
virtual void onActivityPostPaused (jobject /*activity*/) {}
virtual void onActivityPostResumed (jobject /*activity*/) {}
virtual void onActivityPostSaveInstanceState (jobject /*activity*/, jobject /*bundle*/) {}
virtual void onActivityPostStarted (jobject /*activity*/) {}
virtual void onActivityPostStopped (jobject /*activity*/) {}

private:
jobject invoke (jobject, jobject, jobjectArray) override;

0 comments on commit be8a568

Please sign in to comment.
You can’t perform that action at this time.