语法错误:插入“}”以完成阻止

时间:2013-08-06 23:38:48

标签: java android

我的代码一直出错。我正在制作一个应用程序来生成报价。谁能帮我这个?无论我尝试什么,我都会得到“语法错误:插入”}“来完成阻止。”当我插入“}”时,它给出了一个错误,说我的代码是“无法访问”的,当我添加一个括号使其可以访问时,它会将我带回第一个错误并且它只是循环。这让我疯狂!有人可以帮忙吗?谢谢!这是我的代码:

   {

    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);

        }

1 个答案:

答案 0 :(得分:21)

vtvdisplay.setText(" Thank you for downloading Punny Jokes!

看起来您最后错过了");,或者您复制并粘贴错误。