I have a problem, Toast does not appear when I make a request in to my web service, the whole method stays inside my thread, I made a test putting a message out of the thread it appears, but well where I need it, it does not display with the message I need to show to the user.
@Override
public void onClick(View v) {
new Thread(new Runnable() {
@Override
public void run() {
try {
loginDao = new LoginDao(databaseHelper.getConnectionSource());
login = loginDao.queryForId(1);
} catch (SQLException e) {
e.printStackTrace();
}
DadosCadastraisSerealizable dados = new DadosCadastraisSerealizable();
dados.codigo= String.valueOf(login.getCodigoCliente());
dados.usuario=login.usuario;
dados.senha=login.senha;
//expressão regular para enviar somente o numeros.
String[] cepText = edtCep.getText().toString().split("-");
dados.cep= cepText[0]+cepText[1];
dados.bairro= edtBairro.getText().toString();
dados.endereco= edtEndereco.getText().toString();
dados.numero= edtnumero.getText().toString();
dados.complemento= edtComplemento.getText().toString();
dados.foneComercial= edtFoneComercial.getText().toString();
dados.foneResidencial= edtFoneResidencial.getText().toString();
dados.foneCelular= edtFoneCelular.getText().toString();
dados.email= edtEmail.getText().toString();
try {
WebService ws = new WebService();
ws.atuzalizarCadastroCliente(dados);
Toast.makeText(getApplicationContext(), ws.strFault, Toast.LENGTH_SHORT).show();
} catch (IOException e) {
e.printStackTrace();
} catch (XmlPullParserException e) {
e.printStackTrace();
}
}
}).start();
}