René's URL Explorer Experiment


Title: Android Studio error: "Method getText() must be called from the UI Thread, currently inferred thread is worker · Issue #47 · hmkcode/Android · GitHub

Open Graph Title: Android Studio error: "Method getText() must be called from the UI Thread, currently inferred thread is worker · Issue #47 · hmkcode/Android

X Title: Android Studio error: "Method getText() must be called from the UI Thread, currently inferred thread is worker · Issue #47 · hmkcode/Android

Description: Hi. I'm doing a Android Studio Project, with some AsyncTasks, and at some point it gives me the error at the Title. I know that i really can't use method getText it in doInBackground, but i've tried to do the recommended changes from ano...

Open Graph Description: Hi. I'm doing a Android Studio Project, with some AsyncTasks, and at some point it gives me the error at the Title. I know that i really can't use method getText it in doInBackground, but i've trie...

X Description: Hi. I'm doing a Android Studio Project, with some AsyncTasks, and at some point it gives me the error at the Title. I know that i really can't use method getText it in doInBackground, but i...

Opengraph URL: https://github.com/hmkcode/Android/issues/47

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Android Studio error: \"Method getText() must be called from the UI Thread, currently inferred thread is worker","articleBody":"Hi. I'm doing a Android Studio Project, with some AsyncTasks, and at some point it gives me the error at the Title. I know that  i really can't use method getText it in doInBackground, but i've tried to do the recommended changes from another questions, to the code and nothing seems to work. This is my code: \r\n\r\n`public class LoginActivity extends AppCompatActivity {\r\n\r\n\r\n    Button btSignIn;\r\n    Button btSignUp;\r\n    EditText edtEmail;\r\n    EditText edtPassword;\r\n    String CHANNEL_ID = \"personal_notification\";\r\n    int NOTIFICATION_ID = 001;\r\n\r\n    UserDatabase database;\r\n    UserDao userDao;\r\n    User userTemp = new User();\r\n\r\n    SharedPreferences emailSharedPref;\r\n\r\n    ProgressDialog progressDialog, progressDialogDownload;\r\n\r\n    @Override\r\n    protected void onStart() {\r\n        super.onStart();\r\n    }\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_login);\r\n        Log.d(\"MYTAG\", \"inicio \");\r\n        progressDialog = new ProgressDialog(this);\r\n        progressDialog.setCancelable(false);\r\n        progressDialog.setMessage(\"A verificar utilizador...\");\r\n        progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\r\n        progressDialog.setProgress(0);\r\n\r\n\r\n        database = Room.databaseBuilder(getApplicationContext(), UserDatabase.class, \"mi-database.db\").build();\r\n\r\n\r\n        userDao = database.getUserDao();\r\n\r\n\r\n        btSignIn = findViewById(R.id.btSignIn);\r\n        btSignUp = findViewById(R.id.btSignUp);\r\n\r\n        edtEmail = findViewById(R.id.email);\r\n        edtPassword = findViewById(R.id.password);\r\n\r\n\r\n        btSignUp.setOnClickListener(new View.OnClickListener() {\r\n            @Override\r\n            public void onClick(View v) {\r\n                startActivity(new Intent(LoginActivity.this, SignUpActivity.class));\r\n            }\r\n        });\r\n        btSignIn.setOnClickListener(new View.OnClickListener() {\r\n            @Override\r\n            public void onClick(View v) {\r\n                LoadAsyncTaskLogin loadAsyncTaskLogin = new LoadAsyncTaskLogin();\r\n                loadAsyncTaskLogin.execute(userTemp);\r\n            }\r\n        });\r\n\r\n    }\r\n\r\n    public class LoadAsyncTaskLogin extends AsyncTask\u003cUser, Void, User> {\r\n\r\n        @Override\r\n        protected User doInBackground(User... users) {\r\n            String email = edtEmail.getText().toString();\r\n            String password = edtPassword.getText().toString();\r\n\r\n            User user2 = new User();\r\n            user2 = database.getUserDao().getUser(email,password);\r\n\r\n            return user2;\r\n        }\r\n\r\n        @Override\r\n        protected void onPostExecute(User user2){\r\n            Intent intentToWhatToChoose = new Intent(LoginActivity.this,WhatToChoose.class);\r\n\r\n            if(user2 != null){\r\n                if(user2.password.equals(edtPassword.getText().toString())){\r\n                emailSharedPref = getApplicationContext().getSharedPreferences(\"email\",0);\r\n                SharedPreferences.Editor editor = emailSharedPref.edit();\r\n                editor.putString(\"User Successfully Logged In\",user2.email);\r\n                editor.commit();\r\n\r\n                startActivity(intentToWhatToChoose);\r\n                    Toast.makeText(LoginActivity.this, \"Welcome to Our App\", Toast.LENGTH_LONG).show();\r\n                } else {\r\n                    Toast.makeText(LoginActivity.this, \"Incorrect Credentials\", Toast.LENGTH_LONG).show();\r\n                }\r\n            } else {\r\n                Toast.makeText(LoginActivity.this, \"Incorrect Credentials\", Toast.LENGTH_LONG).show();\r\n            }\r\n        }\r\n    }`\r\n\r\nThe error is on \"doInBackground\". What changes do i have to do?","author":{"url":"https://github.com/8150133","@type":"Person","name":"8150133"},"datePublished":"2019-09-11T12:51:56Z","url":"https://github.com/hmkcode/Android/issues/47"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:32b67a9d-994a-fb61-e9df-91ac60a34f8f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD898:1C0841:AC13A4:F6F146:6AFDA68A
html-safe-nonceade6d1b7f4fe6485f0af92bc5633a791c9c9cc07ac32c53c905922b78863abf7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODk4OjFDMDg0MTpBQzEzQTQ6RjZGMTQ2OjZBRkRBNjhBIiwidmlzaXRvcl9pZCI6IjQxMTg5OTU0NjAwODY1OTU5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8ed37835cb3ba8fb9732a5043289c2f535b3f11a4b983fd3f4ef75093152cff0
hovercard-subject-tagissue:492218728
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/hmkcode/Android/47/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1bcc3b4e0b66fffef171647812396c2e58a139f036328ac6b16f941c963d4233/hmkcode/Android/issues/47
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1bcc3b4e0b66fffef171647812396c2e58a139f036328ac6b16f941c963d4233/hmkcode/Android/issues/47
og:image:altHi. I'm doing a Android Studio Project, with some AsyncTasks, and at some point it gives me the error at the Title. I know that i really can't use method getText it in doInBackground, but i've trie...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:username8150133
hostnamegithub.com
expected-hostnamegithub.com
Nonebc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea
turbo-cache-controlno-preview
go-importgithub.com/hmkcode/Android git https://github.com/hmkcode/Android.git
octolytics-dimension-user_id3790597
octolytics-dimension-user_loginhmkcode
octolytics-dimension-repository_id12544093
octolytics-dimension-repository_nwohmkcode/Android
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id12544093
octolytics-dimension-repository_network_root_nwohmkcode/Android
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release0ddf53eb35c87f1f8df13dbf75c3bdadbfc6e969
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/hmkcode/Android/issues/47#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhmkcode%2FAndroid%2Fissues%2F47
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhmkcode%2FAndroid%2Fissues%2F47
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=hmkcode%2FAndroid
Reloadhttps://github.com/hmkcode/Android/issues/47
Reloadhttps://github.com/hmkcode/Android/issues/47
Reloadhttps://github.com/hmkcode/Android/issues/47
hmkcodehttps://github.com/hmkcode
Androidhttps://github.com/hmkcode/Android
Codehttps://github.com/hmkcode/Android
Issues37 (37)https://github.com/hmkcode/Android/issues
Pull requests39 (39)https://github.com/hmkcode/Android/pulls
Actionshttps://github.com/hmkcode/Android/actions
Projectshttps://github.com/hmkcode/Android/projects
Wikihttps://github.com/hmkcode/Android/wiki
Security and qualityhttps://github.com/hmkcode/Android/security
Insightshttps://github.com/hmkcode/Android/pulse
https://github.com/hmkcode/Android
New issuehttps://github.com/login?return_to=https://github.com/hmkcode/Android/issues/47
New issuehttps://github.com/login?return_to=https://github.com/hmkcode/Android/issues/47
Android Studio error: "Method getText() must be called from the UI Thread, currently inferred thread is workerhttps://github.com/hmkcode/Android/issues/47#top
https://github.com/8150133
8150133https://github.com/8150133
on Sep 11, 2019https://github.com/hmkcode/Android/issues/47#issue-492218728
https://github.com/santoshsali
santoshsalihttps://github.com/santoshsali
on Jan 28, 2022https://github.com/hmkcode/Android/issues/47#issuecomment-1024136944
https://github.com/ChinmaySahu1357
ChinmaySahu1357https://github.com/ChinmaySahu1357
on Oct 12, 2023https://github.com/hmkcode/Android/issues/47#issuecomment-1760299225
Sign up for freehttps://github.com/signup?return_to=https://github.com/hmkcode/Android/issues/47
Sign in to commenthttps://github.com/login?return_to=https://github.com/hmkcode/Android/issues/47
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.