I am inside onFocusChangeListenerMethod inside my activity class. How do I get access to my activity object to use in Toast.makeText() method? What other ways are there to display an error message (user has entered incorrect text). Here is my code
I have commented the code in "else" part that I want to fix.
Imad, can you show class code and Log (error) here,that will help us to find the problem solution.
one solution: create class variable Context and set it inside onCreate(); use this variable in your Toast.makeText(getApplicationContext(), "Invalid Value(s) Entered in \"Values\" Field", Toast.LENGTH_LONG).show();
Muhammad Imad Qureshi
posted 7 years ago
Thanks for your reply. I resolved it with the following code. I think you are right. I should be able to use getApplicationContext() too. But this is what I did.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads