Skip to content
Advertisement

my weather app getting crashing after i enter the Toast [closed]

my app was working properly in this code all the city weather data show correctly. i want to add a toast for if someone enter a wrong city name

i can understand what is the error android studio dont give any error . if enter a city name works fine but if i enter a wrong city name or any other word it crashing

working code :::

JavaScript

then i enter the Toast in to this filed now app was crashing

crashing code ….

JavaScript

Advertisement

Answer

You cannot make ui calls from a backgroud thread.Use android OS handler So replace

JavaScript

with

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement