I have a strange problem that I'm struggling with.
It is very basic: trying to show a Toast
message when clicking a imageView
,
the code:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_password);
lock = (ImageView) findViewById(R.id.lock);
lock.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getBaseContext(), "clicked", Toast.LENGTH_SHORT).show();
}
});
}
But for some reason the toast message comes out blank, as if i sent a "" message. if i move the toast line to "oncreate" it will be shown as normal, I have no idea what seems to be the problem