android 为什么我的EditText取得值为空 求解
publicclassAdd2extendsActivity{StringaddName2,addReady2,addIntro2;EditTextadd2Ready,a...
public class Add2 extends Activity {
String addName2, addReady2, addIntro2;
EditText add2Ready, add2Intro;
private Button add2Button;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.add2);
add2Ready = (EditText) this.findViewById(R.id.add2Ready);
add2Intro = (EditText) this.findViewById(R.id.add2Intro);
addReady2 = add2Ready.getText().toString();
addIntro2 = add2Intro.getText().toString();
add2Button = (Button) this.findViewById(R.id.add2Button);
add2Button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(), addIntro2, 1000).show();
急求 展开
String addName2, addReady2, addIntro2;
EditText add2Ready, add2Intro;
private Button add2Button;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.add2);
add2Ready = (EditText) this.findViewById(R.id.add2Ready);
add2Intro = (EditText) this.findViewById(R.id.add2Intro);
addReady2 = add2Ready.getText().toString();
addIntro2 = add2Intro.getText().toString();
add2Button = (Button) this.findViewById(R.id.add2Button);
add2Button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(), addIntro2, 1000).show();
急求 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询