A constructor that takes a context object would work well here.
Declare a context variable
private Context mContext;
Then declare a constructor that takes a context
public listener(Context context){
super();
mContext = context
}
When you need a context use mContext instead of this
.
When you create the listener pass the current context
sr.setRecognitionListener(new listener(this));
Also as an aside in Java class names should always start with a capital so your class should be Listener not listener