@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_register, container, false);
Button btnRegister = (Button) view.findViewById(R.id.actionregister);
final EditText nameText = (EditText) view.findViewById(R.id.rusername);
final EditText passText = (EditText) view.findViewById(R.id.rpassword);
final EditText passConText = (EditText) view.findViewById(R.id.rpasswordr);
btnRegister.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
validate(nameText,passText,passConText);
}
});
return view;
}
public void validate(EditText nameText, EditText passText, EditText passConText){
String userName = nameText.getText().toString();
String password = passText.getText().toString();
String passCon = passConText.getText().toString();
if(userName.trim().length() == 0)
{
nameText.setError("Gebruikersnaam moet ingevuld worden");
if (password != passCon){
passConText.setError("Wachtwoorden moeten gelijk en ingevuld zijn");
}
}
else{
if (password != passCon){
passConText.setError("Wachtwoorden moeten gelijk en ingevuld zijn");
}
else{
mListener.register(userName, password);
}
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof RegisterListener) {
mListener = (RegisterListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement NextPage");
}
}
public interface RegisterListener {
public void register(String userName,String password);
}
So after adding the validation code, I keep getting an getSlotFromBufferLocked: unknown buffer error. My app is still working, but I don't understand why I keep getting errors. Does anyone know why this is happening and what I should change? When trying to run the app it doesn't go to the start page anymore either...
Error report:
07-25 18:06:10.853 2452-2598/com.example.hoofdgebruiker.winkelskortrijk E/Surface: getSlotFromBufferLocked: unknown buffer: 0xaa04afb0
07-25 18:06:10.885 2452-2598/com.example.hoofdgebruiker.winkelskortrijk E/Surface: getSlotFromBufferLocked: unknown buffer: 0xaa04ae60
--------- beginning of system
07-25 18:06:12.852 2452-2598/com.example.hoofdgebruiker.winkelskortrijk E/Surface: getSlotFromBufferLocked: unknown buffer: 0xaa0485b0
I don't understand the answer to the other question. I still have no clue how to solve this, so please someone explain to me what is wrong in my code. I had looked at the other question before even posting here...