androidjsonandroid-volleyjsonobjectrequest

JsonObjectRequest and RequestQueue error


SOLUTION: my problem was with the context, in case anyone else has the same problem.

I am trying to make a request in my android app with JsonObjectRequest and RequestQueue with Volley lib but I am getting an error continuously.

First, I tried to use just JsonObjectRequest (without RequestQueue) but I didn't get any data so I tried to use RequestQueue.


Solution

  • as per my above comment

    You context is null

    Intialize your context like this

    Context context=YourActivity.this; 
    

    or

    Context context=getApplicationContext();