Looking at the C# code you have:
public void StartSpeechRecognition() {
AndroidJavaObject speechResultListener = new AndroidJavaObject("com.example.unityandroidplswork.STTPlugin$SpeechRecognitionResultListener", this);
CallOnMainThread(() =>
{
speechRecPlugin.Call("startSpeechRecognition", speechResultListener);
});
}
The call to the constructor of the
AndroidJavaObject
is being passed the
this
variable, which is an instance of the enclosing
SpeechRecog
class. So it is reasonable to assume that that is where the problem lies. Exactly why the constructor is objecting to that parameter can only be answered by studying the documentation for the
AndroidJavaObject
class.
[edit]
Looking at the documentation at
Unity - Scripting API: AndroidJavaObject.AndroidJavaObject[
^], it would appear that the constructor is expecting the name of an existing Java class. but you do not appear to have a class with the name
com.example.unityandroidplswork.STTPlugin$SpeechRecognitionResultListener
. The only reference I can see to that name is a declared interface in your
STTPlugin
class.
[/edit]