为什么点击注册按钮直接退出
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class LoginActivity extends Activity {
private Button dengluButton;
private Button zhuceButton;
private String APPKEY="13449b5c497f6";
private String APPSECRETE="a5a1af3bbea1aba0f1c5d07ed5bd7e13";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login_activity);
SMSSDK.initSDK(this,APPKEY,APPSECRETE);
dengluButton=(Button) findViewById(R.id.button_denglu);
zhuceButton=(Button)findViewById(R.id.button_zhuce);
//初始化
SMSSDK.initSDK(this,APPKEY,APPSECRETE);
dengluButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent=new Intent(LoginActivity.this,MainActivity.class);
startActivity(intent);
}
});
zhuceButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
RegisterPage registerPage=new RegisterPage();
//注册回调事件
registerPage.setRegisterCallback(new EventHandler(){
@Override
public void afterEvent(int event, int result, Object data) {
// TODO Auto-generated method stub
if(result==SMSSDK.RESULT_COMPLETE){
HashMap<String, Object> maps=(HashMap<String, Object>) data;
String country=(String) maps.get("country");
String phone=(String) maps.get("phone");
}
}
});
registerPage.show(LoginActivity.this);
}
});
}
//提交用户信息
public void submitUserInfo(String country,String phone){
Random r=new Random();
String uid=Math.abs(r.nextInt())+"";
String nickName="carlove";
SMSSDK.submitUserInfo(uid, nickName, null, country, phone);
submitUserInfo(country, phone);
}
}
为什么点击按钮注册按钮直接退出