I have an app that gets given via api using volley
My code:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tela1);
ImageView myImageView = (ImageView) findViewById(R.id.imageView);
myImageView.setImageResource(R.drawable.imagem);
requestQueue = Volley.newRequestQueue(this);
results = (TextView) findViewById(R.id.textView2);
datav = (TextView) findViewById(R.id.textA);
JsonArrayRequest arrayreq = new JsonArrayRequest(JsonURL,
new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
try {
JSONObject obj = response.getJSONObject(0);
Double ask = obj.getDouble("ask");
String data = obj.getString("create_date");
results.setText("Vale R$: " + ask);
datav.setText("Atualizado em: " + data);
} catch (JSONException e) {
e.printStackTrace();
}}},
new Response.ErrorListener() {
@Override
// Handles errors that occur due to Volley
public void onErrorResponse(VolleyError error) {
Log.e("Volley", "Error");
}
}
);
I want to pass the value of the "ask" that is received to another screen, how do I do this?