1

This is the code

@Override
protected String doInBackground(String... params) {
List<NameValuePair>param=new ArrayList<NameValuePair>();
param.add(new BasicNameValuePair("token_type",tToken));
param.add(new BasicNameValuePair("access_token",acToken));

String json=jsonParser.makeHttpRequest(URL_ORDERS,"GET",param);
Log.d("JSON ",json);

This is the tToken and acToken

JSONObject obj=new JSONObject(getIntent().getStringExtra("jsonToken"));
Log.d("Orders Response",obj.toString());

acToken= obj.getString("access_token");
tToken=obj.getString("token_type");

The problem is in the line String json=jsonParser.makeHttpRequest(URL_ORDERS,"GET",param);

It gives me this error required java.lang.String found org.json.JSONObject

i do understand the problem but i don't know how to fix it

2
  • maven thank you for the edit proposal , now i will know how to post my code on stackoverflow Commented Sep 19, 2014 at 11:48
  • use bold font only when they are needed .. else it will show arrogance ... :) Commented Sep 22, 2014 at 5:22

1 Answer 1

1

it means that jsonParser.makeHttpRequest retuns a JSONObject and not a String. Change

 String json=jsonParser.makeHttpRequest(URL_ORDERS,"GET",param);

to

 JSONObject json=jsonParser.makeHttpRequest(URL_ORDERS,"GET",param);
Sign up to request clarification or add additional context in comments.

1 Comment

Sit thank you a lot i will acept your'e answer later(now i can't before it's to early, or so stack overflow system says)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.