I am having some trouble with my toast context for my submit button. I’ve tried setApplicationContext() and MyActivity.this but neither works… and I can’t quite work it out. Anyone have any ideas?
The bit I’m having trouble with is:
Toast.makeText(CustomItemizedOverlay.this, "clicked", Toast.LENGTH_SHORT).show();
EDIT
Turns out the problem wasn’t just the context, the solution “context” works fine if a public context variable is stated in the class. It was in fact the some other part of the code that caused it to crash.
Try changing
to
Assuming you’ve used the constructor that sets the
contextparameter.