API problem for lyrics app

Hello koders,
I developed a lyrics app using API this is my first app using API, the app works fine but am experiencing an issue whenever I enter an incorrect artist name and song I made it to show an alert saying no lyrics found the problem is that when it shows no lyrics found it also show an alert saying check your json and try again. Argument must be a valid json. I don’t know how I can remove this allert so that only no lyrics found will be shown. I even tried using when error occur component but did not work. Please is there any way I can overwrite it.

1 Like

i also dont know much about that, but lets see, how you are arranging that songs in any list or showing direct?

Show your relevant blocks

1 Like

Not with my PC right now but I can share APK if you want.

Am not arranging it in any list I am showing it on a label.

but when you are using search? then in which thing you are searching? when you goes to your computer then share blocks so we can see that

1 Like

Ok no problem

you have to find out what the server returns in that case… just add an if statement like this

if response = no lyrics found
then display a nice warning message
else do your processing

Taifun

2 Likes

Ok. Can I say this under the web got text. If response = lyrics not found then snack bar show message dialog “lyrics not found” else parse json then set attribute name to ‘‘lyrics’’ will this work??.

1 Like

sure… what about trying it… of course you have to check for the correct server response
Taifun

2 Likes

Thank you, I will get back to you.

Thank you it works fine as expected I just changed the response content to response code and I set response code to 404 and it is :100:% working.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.