Java – syntax error: Insert ‘}’ to complete the block

My code keeps making mistakes. I'm making an application to generate a quotation. Who can help me with this? No matter what I try, I will get "syntax error: insert"} "to complete the blocking. When I insert"} ", it gives an error, saying that my code is" inaccessible ". When I add a bracket to make it accessible, it will bring me back to the first error and it's just a loop. It makes me crazy! Can I help you? thank you! This is my code:

   {

    vbjokes = (Button) findViewById(R.id.bjokes);
    vbabout = (Button) findViewById(R.id.babout);
    vtvdisplay = (TextView) findViewById(R.id.tvdisplay);
    vbjokes.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub


        }
    });
    vbabout.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            vtvdisplay.setText("                                                                 Thank you for downloading Punny Jokes! 
            vtvdisplay.setTextColor(Color.BLACK);
            vtvdisplay.setTextSize((float) 20d);
            vtvdisplay.setBackgroundColor(Color.GRAY);

        }
    });


    final View controlsView = findViewById(R.id.fullscreen_content_controls);
    final View contentView = findViewById(R.id.tvdisplay);


    msystemUIHider = systemUIHider.getInstance(this, contentView,
            HIDER_FLAGS);
    msystemUIHider.setup();
    msystemUIHider
            .setOnVisibilitychangelistener(new systemUIHider.OnVisibilitychangelistener() {
                int mControlsHeight;
                int mShortAnimTime;

                @Override
                @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
                public void onVisibilityChange(boolean visible) {
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {

                        if (mControlsHeight == 0) {
                            mControlsHeight = controlsView.getHeight();
                        }
                        if (mShortAnimTime == 0) {
                            mShortAnimTime = getResources().getInteger(
                                    android.R.integer.config_shortAnimTime);
                        }
                        controlsView
                                .animate()
                                .translationY(visible ? 0 : mControlsHeight)
                                .setDuration(mShortAnimTime);
                    } else {

                        controlsView.setVisibility(visible ? View.VISIBLE
                                : View.GONE);
                    }

                    if (visible && AUTO_HIDE) {
                        delayedHide(AUTO_HIDE_DELAY_MILLIS);
                    }
                }
            });

    contentView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (TOGGLE_ON_CLICK) {
                msystemUIHider.toggle();
            } else {
                msystemUIHider.show();
            }
        }
    });


    findViewById(R.id.babout).setOnTouchListener(
            mDelayHideTouchListener);

        }

resolvent:

Sorry, I will add comments, but my reputation is too low

Vtvdisplay. Settext ("thank you for downloading Penny jokes!

It looks like you missed a "); in the end, you copied and pasted it wrong

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>