Your class TestActivity
must extend AppCompatActivity
class so that the onCreate
method could be overriden. Your class isn’t using Inheritance or Interface Implementation, that’s why @Override
annotation is throwing error.
public class TestActivity extends AppCompatActivity
Second, your code for showing Toast
is wrong. This is how you can fix that.
Toast.makeText(this, id+"/"+pass, Toast.LENGTH_SHORT).show();
Third, remove @Override
annotation from the method you’re using for showing toast and also rename it to something else because it should not be same as the class name.
public void showToast(String id, String pass) {
Toast.makeText(this, id+"/"+pass, Toast.LENGTH_SHORT).show();
}
solved Android AlertDialog wont came out for instance [closed]