android - Passing dynamic string resource to "Toast" -
i trying pass dynamic string "toast" .
i made customized function :
private void maketoast(string message) { toast.maketext(this, message, toast.length_long).show(); }
and able use function pass toast messages :
maketoast("you must enter pin code authentication.");
what trying achieve pass dynamic string . declared in strings.xml :
<string name="must_pin">you must enter pin code authentication</string>
and tried pass :
maketoast(r.string.must_pin);
but not accept , says cannot accept "int" .... how can pass maketoast . right format ?
the way have it, passing reference id. need use getstring()
maketoast(getstring(r.string.must_pin));
Comments
Post a Comment