2017-05-01 3 views
0

gamemaker 스튜디오 용 음성 앤드 로이드 확장 텍스트를 만들기 위해이 오류가 발생합니다. 05-01 17 : 16 : 41.304 16939 17013 I yoyo : 게임 내 확장 기능을 사용하려고 할 때 확장 클래스에 argfree 메소드가 없습니다. getMic [] . 게임이 중단되지 않고 확장 프로그램에서 아무 것도 찾을 수 없습니다. argfree 방법은 정확히 무엇입니까?GAMEMAKER STUDIO 용 확장자 없음 확장 클래스에 argfree 메소드를 찾을 수 없음

또한 public 메서드로 onCreate 메서드를 변경하고 GM : S 및 다른 여러 가지를 호출했지만 행운은 없습니다. 여기에 관련 코드가 있습니다. 자세한 정보가 필요하면 문의하십시오.

자바 클래스 TtsStt :

<activity android:name="${YYAndroidPackageName}.TtsStt" 
android:theme="@style/Theme.AppCompat.NoActionBar" 
android:label="@string/app_name" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     /> 
    /> 

및 매니페스트에서 Gradle을 종속성을 주입 : :이 주입 한

내 매니페스트에서 활동 수준에
 protected void onCreate(Bundle savedInstanceState) { //HERE is where I tried replacing 
//protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState); 
//with just public void initTTS() {...} but got same error 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.tts_stt); 
    preferences = getSharedPreferences(PREFS,0); 
    editor = preferences.edit(); 
    editor.putString(TSTYLE, "military time").apply(); 
    RunnerActivity.CurrentActivity.findViewById(R.id.microphoneButton).setOnClickListener(new View.OnClickListener() { 
     @Override 
     public void onClick(View v) { 
      listen(); 
     } 
    }); 
    loadQuestions(); 
    tts = new TextToSpeech(RunnerActivity.CurrentActivity, new TextToSpeech.OnInitListener() { 
    @Override 
     public void onInit(int status) { 
      if (status == TextToSpeech.SUCCESS) { 
       int result = tts.setLanguage(Locale.US); 
       if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) { 
        Log.i("yoyo", "This Language is not supported"); 
       } 
       speak("Hello"); 
      } else { 
       Log.i("yoyo", "Initilization Failed!"); 
      } 
     } 
    }); 
} 
public void getMic() { 
      listen(); 
} 


private void listen(){ 
    Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); 
    i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); 
    i.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()); 
    i.putExtra(RecognizerIntent.EXTRA_PROMPT, "Say something"); 
    try { 
     RunnerActivity.CurrentActivity.startActivityForResult(i, 100); 
    } catch (ActivityNotFoundException a) { 
     Log.i("yoyo", "Your device doesn't support Speech Recognition"); 
    } 
} 

compile fileTree(dir: 'libs', include: ['*.jar']) 
compile 'com.android.support:appcompat-v7:22.2.1' 

답변

0

글쎄 대답은 매우 예상치 못한데, gamemaker studio와 android 사이의 코드를 확장 할 때 Java, onCreate 메서드를 사용해야하는 경우 보호 된 void onCreate (.......)를 작성하면 안됩니다. 대신 public void onCreate (......) 을 사용해야합니다. 평범하고 자바에서 예상하고 난 단지 그것을 왜 알아 냈어요 allways 보호 allways 및 다른 사람의 반응을 보았다 왜 달리에 할 이유가 없다, 그래서 내가 그랬어!

관련 문제