這是我的主要我有一個不響應的按鈕。關閉屏幕並重新打開後,屏幕響應。其他按鈕正常工作。幫助請
package com.example.student.poker;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import static com.example.student.poker.variables.*;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setContentView(R.layout.activity_main);
playeronestack = (TextView) findViewById(R.id.playeronechip);
playertwostack = (TextView) findViewById(R.id.playertwochip);
playeronecheckbutton = (Button) findViewById(R.id.playeronecheck);
playertwocheckbutton = (Button) findViewById(R.id.playertwocheck);
playeronebetbutton = (Button) findViewById(R.id.playeronebet);
playertwobetbutton = (Button) findViewById(R.id.playertwobet);
playeronefoldbutton = (Button) findViewById(R.id.playeronefold);
playertwobutton = (Button) findViewById(R.id.playertwofold);
playeronebettext = (EditText) findViewById(R.id.playeronespecifybet);
playertwobettext = (EditText) findViewById(R.id.playertwospecifybet);
playeronefirstcard = (ImageView) findViewById(R.id.playeronefirst);
playertwofirstcard = (ImageView) findViewById(R.id.playertwofirst);
playeronesecondcard = (ImageView) findViewById(R.id.playeroneSecond);
playertwosecondcard = (ImageView) findViewById(R.id.playertwosecond);
firstflopcard = (ImageView) findViewById(R.id.firstflop);
secondflopcard = (ImageView) findViewById(R.id.secondflop);
thirdflopcard = (ImageView) findViewById(R.id.thirdflop);
fourthflopcard = (ImageView) findViewById(R.id.fourthflop);
fifthflopcard = (ImageView) findViewById(R.id.fifthflop);
dealerbuttonone = (ImageView) findViewById(R.id.dealerbuttonone);
dealerbuttontwo = (ImageView) findViewById(R.id.dealerbuttonone);
pottext = (TextView) findViewById(R.id.potsize);
startbutton = (TextView) findViewById(R.id.startbutton);
if(turn == 2){
preflop.preflopturn();
}
if(turn == 7){
startbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
turn = 1;
}
});
}
if(turn == 1) {
dealing.deal();
}
}
}
我知道它的馬虎我剛剛開始;) 又將在7開始了,當我打它它不響應。但是在關閉屏幕並再次打開後,它會響應。它很奇怪; - ;.任何幫助? 另外我有一個不同類的所有變量。第一回合應該處理牌,第二回合開始時顯示牌。在deal.deal。它設置匝2.它的工作原理,但你必須關閉屏幕並打開它進行
其中ID聲明轉彎,什麼是默認值? –
我用我所有的變量在不同的java類中聲明它。它開始於7 –
btw我有2個XML文件,它們是activity_main.xml和activity_main.xml(陸地)。不確定它使用的是什麼; - ; –