I already searched on this but couldnt find the answer as I dont know in which side I am doing wrong. Whenever I class this method I got the error from where I am calling.
I am calling from this method in checkpass.java class
private void checking() {
okbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TestClass testClass = new TestClass();
testClass.testing();
}
});
}
I am calling this method which is located in another class
public void testing(){
Toast.makeText(TestClass.this, "Testing class", Toast.LENGTH_SHORT).show();
}
I am getting this error:
at android.widget.Toast.makeText(Toast.java:287)
at com.futureappspk.WeTextFree.TestClass.testing(TestClass.java:18)
at com.futureappspk.WeTextFree.CheckPass$1.onClick(CheckPass.java:43)
at android.view.View.performClick(View.java:4746)