0

i am having problem in getting the id in second activity, i am passing id in bundle like below in first activity

Bundle bundle = new Bundle();
                bundle.putInt(Constants.ID, featured.getId());
                bundle.putString(Constants.TITLE, "Team");
                openAcitivty(getBundle("Questions" , (Serializable) featured.getAll().getQa()) , ProviderQAactivity.class );

but when i am getting the id in the second activity, it is showing me zero here

 uid = getIntent().getBundleExtra(Constants.DATA).getInt(Constants.ID);

please suggests something.

Aniruddh Parihar
  • 3,072
  • 3
  • 21
  • 39
S.H
  • 139
  • 13

2 Answers2

0

Try

getIntent().getExtras().getInt(Constants.ID)
getIntent().getExtras().getString(Constants.TITLE)

may solve your problem.

Also let us know whats inside below function. Are you passing the bundle correctly to next activity via intent.

  `openAcitivty(getBundle("Questions" , (Serializable) featured.getAll().getQa()) , ProviderQAactivity.class );`

It must contain some code as

intent.putExtras(bundle);
Nivedh
  • 971
  • 1
  • 8
  • 19
0

Try this way..

uid = getIntent().getExtras().getInt(Constants.ID);

when called below line it give bundle object.

Bundle bundle = getIntent().getExtras();