I have a location listener activity and I want to make toast notifications. But it will not let me pass this
as the context. How should I make toast work?
If the toast is located inside your activity class, you could use YourActiviy. this where YourActivity is the class name. If it's outside your class, you'll need to get your activity context (pass it in the constructor etc). Show activity on this post.
If the toast is located inside your activity class, you could use YourActiviy.this
where YourActivity
is the class name. If it's outside your class, you'll need to get your activity context (pass it in the constructor etc).
If you are in the inner Class then try this also
getApplicationContext()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With