4

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

   {

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

        }
4

1 回答 1

21

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

看起来您");最后缺少 a 或者您复制并粘贴错误。

于 2013-08-06T23:43:58.927 回答