Adroid Studio Error View.setOnClickListener Error: Class \'anonymous class deriv
ID: 3748563 • Letter: A
Question
Adroid Studio Error
View.setOnClickListener Error: Class 'anonymous class derived from OnClickListener ' must either be declared abstract or implement abstract method 'onClick(View)' in 'OnClickListener '
@Override Error: Method does not override method from its superclass
package com.example.gregorybacon.assignment_1; import android.content. Intent; import android. support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view. View; import android.widget.Button; public class MainScreen extends AppCompatActivity f @0verride protected void onCreate(Bundle savedInstanceState) ( super.onCreate(savedInstanceState); setContentView(R. layout.activity main_screen); Button button_unlock-(Button) findViewById(R.id.button_unlock); button_unlock.setOnClickListener(new View.OnClickListener) L aoverride public void OnClick(View view) startActivity(new Intent( packageContext: MainScreen.this, SecondScreen.class));Explanation / Answer
give the correct name of the onClick() method, given metjhod is wrong correct it.
correct:
give the correct method name
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.