したがって、エラーが発生しているコードを投稿するだけです。なぜこれが機能しないのかについて誰かが考えている場合は、説明を添えてお知らせください。(これがコーディングの悪い方法であるなどとだけ言ってはいけません) (または、少なくとも自分で説明する場合)。したがって、以下のコードは、誰かがクリックした色が true の場合に別の画面に切り替えることになっています!
public boolean onTouch(View v, MotionEvent event) {
int x = (int) event.getX();
int y = (int) event.getY();
if(isInsideCircle(x, y) == true){
//Do your things here
if(redColor == lastColor){
// error is here Intent i = new Intent(this, YouFailed.class);
// and here Activity.startActivity(i);
} else {
addPoints++;
}
}else {
}
return true;
}
次の 2 つのエラーがあります。
コンストラクターIntent(DrawingView, Class<YouFailed>)
は未定義です
と
タイプ Activity から非静的メソッド startActivity(Intent) への静的参照を作成できません