2
I have the following class:
public class RetornaUsuarioActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
AcessoRest ar = new AcessoRest();
String chamadaWS;
chamadaWS = "http://www.cordeiro-it.com.br/SOUPROGRESSO/Ctrl/recuperaUser.php";
String resultado = ar.chamadaGet(chamadaWS);
System.out.println(resultado);
Log.i("JSON:",resultado);
try {
// Tratamento de erros
JSONObject jsonResponse = new JSONObject(resultado);
JSONArray usuarios = jsonResponse.getJSONArray("usuarios");
for(int i=0; i < usuarios.length(); i++) {
JSONObject jsonobject = usuarios.getJSONObject(i);
String nome = jsonobject.getString("nome");
String cpf = jsonobject.getString("cpf");
/*TextView tv = (TextView) findViewById(R.id.txtMessage);
tv.setText(nome);*/
}
} catch (Exception e) {
// ERRO
e.printStackTrace();
System.out.println("Erro ao retornar dados do usuário");
}
}
}
Like I pick up and play the values of NAME AND NUMBER who are in that for
in another class of Activity?
Type I want to take these values to see if the user exists or not, then save to a TXT file.
you can pass values between
Activitys
usingParcelable
andSerializable
, take a look at this question [http://answall.com/a/70456/10315] where @sicachester answered in the morning can help you– Wellington Avelino