Skip to content
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

method inUiThread was not working as expected #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

upender-reddy
Copy link

@upender-reddy upender-reddy commented Apr 15, 2020

App was crashing with RuntimeException("this should be called in Main Thread")
due to method "inUiThread" returning false even though it is running in main thread .
After changing logic to check the main thread app is working fine.

@@ -669,6 +669,8 @@ public String toString() {
}

private boolean inUiThread() {
return Thread.currentThread().getId() == 1;
// return Thread.currentThread().getId() == 1;
return Looper.myLooper() == Looper.getMainLooper()

Choose a reason for hiding this comment

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

hey @upender-reddy forgot to add semicolon as it's .java file.

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.

None yet

2 participants