Back to project page ChuangYi.
The source code is released under:
MIT License
If you think the Android project ChuangYi listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package tjuci.dl.myweixin; /*from w ww.j a v a 2 s . c o m*/ import android.app.Activity; import android.app.AlertDialog; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.view.Window; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; /** * ???? ??????main.xml?? ???????? * @author dl * */ public class MyWeiXinActivity extends Activity implements OnClickListener{ Button loginBtn,registBtn; EditText userEdit,passwdEdit; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); loginBtn = (Button)findViewById(R.id.main_login_btn); registBtn = (Button)findViewById(R.id.main_regist_btn); passwdEdit = (EditText)findViewById(R.id.login_password); userEdit = (EditText)findViewById(R.id.login_username); loginBtn.setOnClickListener(this); registBtn.setOnClickListener(this); } @Override public void onClick(View v) { int btnId = v.getId(); switch (btnId) {//????????? case R.id.main_login_btn://????? String userEditStr = userEdit.getText().toString().trim(); String passwdEditStr = passwdEdit.getText().toString().trim(); if(("".equals(userEditStr) || null == userEditStr) || ("".equals(passwdEditStr) || null == passwdEditStr)){//???????????????????? Toast.makeText(MyWeiXinActivity.this,"?????????????????", Toast.LENGTH_LONG).show(); } else { Intent intent = new Intent(MyWeiXinActivity.this, LoginIndex.class); startActivity(intent);//?????????Activity ????????? ????????? ???action??? ??? this.finish(); Log.i("-------------", "------------------"); } break; case R.id.main_regist_btn://???? break; } } }