iは、私はファーストクラス別のクラスの呼び出しメソッドはどうですか?
First.class
public void countIN (View view) {
counter++;
if (counter == 3){
if (mInterstitialAd.isLoaded()){
mInterstitialAd.show();
}
}
}
で私の方法を2クラスに入れていると私は私の最初のクラスで
Second.class
First myMethod = new First();
........
private void onClickButton(final ExpandableLayout expandableLayout) {
expandableLayout.toggle();
myMethod.countIN();
}
を私のメソッドを呼び出したいです
しかし、このエラーが発生します。StackTrace
Error:(85, 17) error: method countIN in class RecyclerViewActivity cannot be applied to given types;
required: View
found: no arguments
reason: actual and formal argument lists differ in length
エラーが明らかに、メソッド '公共ボイドcountIN(ビューVであるように思わ使用view) 'は、' View'の引数インスタンスとして**が必要ですが、 'myMethod.countIN()'を呼び出すことによって**そのインスタンスを提供していないと宣言されています。 'myMethod.countIN(someViewInstance)'が必要です。 – Pshemo