Problems when implementing OnLongClickListener [closed]

0

The error:

  

Error: (36, 10) error: reached end of file while parsing

I know the error is at the end, but I can not solve it

My code:

public class MainActivity extends AppCompatActivity {

    ImageView logo_app;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        getSupportActionBar().hide();
        getWindow().setNavigationBarColor(getResources().getColor(R.color.colorbarra_inf));

        logo_app = (ImageView) findViewById(R.id.logo_app);

        logo_app.setOnLongClickListener(new View.OnLongClickListener() {
            public boolean onLongClick(View v) {
                Animation startRotateAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotate_image);
                logo_app.startAnimation(startRotateAnimation);
                return true;

            }
        }
    
asked by UserNameYo 26.01.2017 в 15:09
source

1 answer

4

You are missing two keys } . The closing of the onCreate and the closing of the class:

public class MainActivity extends AppCompatActivity {

    ImageView logo_app;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        getSupportActionBar().hide();
        getWindow().setNavigationBarColor(getResources().getColor(R.color.colorbarra_inf));

        logo_app = (ImageView) findViewById(R.id.logo_app);

        logo_app.setOnLongClickListener(new View.OnLongClickListener() {
            public boolean onLongClick(View v) {
                Animation startRotateAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotate_image);
                logo_app.startAnimation(startRotateAnimation);
                return true;

            }
        }; //; aquí
   } // aquí
} // aquí también
    
answered by 26.01.2017 / 15:25
source