This is probably because you’re trying to display something on doInBackground(). doInBackground runs in a worker thread which cannot do any UI work (including showing Toasts, which is what you’re doing). Instead, all UI work should be done on onPostExecute().
More Related Contents:
- get contact info from android contact picker
- show an alert dialog in broadcast receiver after a system reboot
- Differences between TextWatcher ‘s onTextChanged, beforeTextChanged and afterTextChanged
- How to set time to device programmatically
- Why do I want to avoid non-default constructors in fragments?
- How to add a fast-scroller to the RecyclerView
- Problems with GridView inside ScrollView in android
- Android WebView – Intercept clicks
- MediaRecorder start failed: -38
- Android: Using ObjectAnimator to translate a View with fractional values of the View’s dimension
- Resource not found TextView
- Doze mode and foreground service
- Action buttons doesn’t show up on Action Bar? [duplicate]
- APK signing error : Failed to read key from keystore
- Best way to update data with a RecyclerView adapter [duplicate]
- Defining a percentage width for a LinearLayout? [duplicate]
- Android Studio – ADB Error – “…device unauthorized. Please check the confirmation dialog on your device.”
- Install app via usb: The device is temporarily restricted
- Cordova – white screen after splash, no exceptions in console
- Interstitial Admob ads: “IllegalStateException: Only fullscreen activities can request orientation”
- Android Design Support Library expandable Floating Action Button(FAB) menu
- Android – Detect End of Long Press
- Service Intent must be explicit: Intent
- How to Get the Time spent on an application in Android Programmatically
- What is the best IDE to develop Android apps in? [closed]
- Text/Layout Alignment in Android (textAlignment, gravity)
- In android how to set navigation drawer header image and name programmatically in class file?
- How to use Gradle to generate Eclipse and Intellij project files for Android projects
- Sync Android devices via GPS time?
- Undesired onItemSelected calls