Fragment

startActivity(new Intent(getActivity(), CatalogItem.class) .putExtra("oId",jsonArrayResponse.getJSONObject(position).getString("oId"))); getActivity().overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right); 

Activit

 oId = getIntent().getIntExtra("oId"); Log.e("AAAAA=onCreate", String.valueOf(oId)); 

In the Fragment

 E/AAAAA=onCreate: 1280 

In Activi

 E/AAAAA=doInBackground: 8 

Why is the value not transmitted? and where does the number 8 come from. When should it be 1280?

  • Tried to transfer there some number, not from json, for the test? - Kirill Stoianov
  • @KirillStoianov, yes transmitted. - Andro
  • Are you sure that the value you get from JSON is correct? and why do you need String.valueOf if oId and so is a string? - Kirill Stoianov
  • @KirillStoianov, In the JSon string. I am transferring it to Activi. From Activi I have to get Int. But I get 8. Instead of 1280 - Andro
  • one
    I still do not understand why you put in the line, and get out of it int. Try getStringExtra () instead of getIntExtra () - Kirill Stoianov

0