Skip to content

Use ActivityLifecycleCallbacks for start,stop,pause and resume events#71

Merged
palaima merged 2 commits intopalaima:devfrom
remcomokveld:feature/lifecyclecallbacks
Jan 29, 2017
Merged

Use ActivityLifecycleCallbacks for start,stop,pause and resume events#71
palaima merged 2 commits intopalaima:devfrom
remcomokveld:feature/lifecyclecallbacks

Conversation

@remcomokveld
Copy link
Copy Markdown

No description provided.

@spirosoik
Copy link
Copy Markdown

+1


@Override
public void onActivityPaused(Activity activity) {
if (mActivity == activity) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may use .equals() instead for checking equality in objects?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the lifecycle callbacks and the debug drawer are installed for that particular instance of an Activity I think you would have to check if they are actually the same instance. So object equality is needed here

Copy link
Copy Markdown
Author

@remcomokveld remcomokveld Nov 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also android.app.Activity itself does not override equals() itself the implementation from the Object class will be used which is return (this == obj);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true story just also checked that equals is not be overrided by activity

@palaima palaima merged commit 1a15fe8 into palaima:dev Jan 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants