模拟器点Submit提交,崩溃
package haha;
import cn.bmob.v3.Bmob;
import cn.bmob.v3.listener.SaveListener;
import com.example.haha.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends Activity{
private EditText mName,mFeedback;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.buju);
Bmob.initialize(this, "c324dadc9c0ce09e0a6b9b479f55ccb7");
mName=(EditText) findViewById(R.id.name);
mFeedback=(EditText) findViewById(R.id.Feedback);
}
public void submit(View view){
String name=mName.getText().toString();
String feedback=mFeedback.getText().toString();
if(name.equals("")||feedback.equals("")){
return;
}
Frrdback feedbackobj=new Frrdback();
feedbackobj.setName(name);
feedbackobj.setFeedback(feedback);
feedbackobj.save(MainActivity.this, new SaveListener() {
@Override
public void onSuccess() {
// TODO Auto-generated method stub
Toast.makeText(MainActivity.this, "submit success", Toast.LENGTH_LONG).show();
}
@Override
public void onFailure(int arg0, String arg1) {
// TODO Auto-generated method stub
Toast.makeText(MainActivity.this, "submit failure", Toast.LENGTH_LONG).show();
}
});
}
}