My code is
Context c = getApplicationContext();
CharSequence c1 = "Invalid Data Entered";
Toast t= Toast.makeText(c, c1, Toast.LENGTH_SHORT);
t.show();
it showing NULL POINTER EXCEPTION AT Toast.makeText() line
Any help..?
thanks..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It was actually because i was calling it from a different class and not an activity.. that was the reason.. IV can’t create Toast in an Activity which is not running..