这是我的主要我有一个不响应的按钮。关闭屏幕并重新打开后,屏幕响应。其他按钮正常工作。帮助请
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(陆地)。不确定它使用的是什么; - ; –