val InterstitialId = dataSnapshot.child("interstitial_id").value.toString()
This line will return a string when you call the .toString method, 2 lines below you are passing this variable to a .getString and according to the documentationgetString() expects an Int not a String.
2
Answers
So looking at your code:
This line will return a string when you call the
.toString
method, 2 lines below you are passing this variable to a.getString
and according to the documentationgetString()
expects an Int not a String.What is the problem? The IDE itself tells you, an Int was expected but you are passing a String.
To get values from resources, for example, strings, themes, etc… you need to pass an Int or id of the resource, which is obtained by doing