0

Hello guys I have one url for my which is connected through id, here I am using user_login_id and response is look like this..

    {"interestreceived":[{"received_detail_id":2783,"interest_id":1288,"name":"Monali Patel","profile_id":"GM453843",
     "image":"","cast":"Not Willing to specify","age":"24","location":"","user_status":"Accept"}]}

Here I have received_detail_id in above JSON,,

now in my next JSON Response

here I am using both ids,and in my code I am using put extra and get extra to pass values

String matchId=this.getIntent().getStringExtra("received_detail_id");  
String Id=this.getIntent().getStringExtra("user_login_id");

USER URL:

USER_URL="http://mywebsitename.com/webservice/interestreceiveddetail?version=apps&received_detail_id="+matchId+"&user_login_id="+Id;

Is this right way to do?because I am not getting output

  • have you check matchId and Id before detail url call ? and also check url in browser see what response are came. – Haresh Chhelana Dec 02 '14 at 04:59
  • response is perfect there is no problem,but tell me that the way i am concatenate the URL string is right or wrong? –  Dec 02 '14 at 05:00
  • obviously if is not creating any problem then you in right track brother. – Haresh Chhelana Dec 02 '14 at 05:03
  • @HareshChhelana I mean is this right way to concatenate the strings USER_URL="http://mywebsitename.com/webservice/interestreceiveddetail?version=apps&received_detail_id="+matchId+"&user_login_id="+Id; –  Dec 02 '14 at 05:07
  • @HareshChhelana it shows error like this Key user_login_id expected String but value was a java.lang.Long. The default value was returned. –  Dec 02 '14 at 05:11
  • I think you passing user_login_id value as Long and try to get using String so try this : String Id=String.valueOf(this.getIntent().getLongExtra("user_login_id",0)); – Haresh Chhelana Dec 02 '14 at 05:20
  • @HareshChhelana whne i use sysout below your line it shows 0 instead 2650,can you tell me why? –  Dec 02 '14 at 05:24
  • can you please post how you pass those both id ? – Haresh Chhelana Dec 02 '14 at 05:36
  • simply using putextra and getextra –  Dec 02 '14 at 05:40
  • post your code how you passing it –  Dec 02 '14 at 05:40
  • intent.putExtra("id", id); StringId=this.getIntent().getStringExtra("id"); –  Dec 02 '14 at 05:44
  • 1
    I think you are passing same id in different pages,check your putextra again from where your are passing values –  Dec 02 '14 at 05:46

1 Answers1

0

check this it will give you way to how to use putextra and getextra How to use putExtra() and getExtra() for string data

Community
  • 1
  • 1