1

I have a problem concerning passing data from AsuycTask class to fragment class. I have AyncTask class that get data from web service as a string and i want to pass the result from onPostExecute(String result) method to fragment but I always get NullPointerException, i've tried to make a static variable in the fragment class and make that static variable equals the result then i made Toast to show the result of that variable but the first Toast gets Null and the Second Toast gets the result!

Peter Bassem
  • 11
  • 1
  • 1
  • 2
    It may be worth reading this post. Overall, static variables is not how you share data across android processes http://stackoverflow.com/questions/9963691/android-asynctask-sending-callbacks-to-ui – OneCricketeer Jun 12 '16 at 16:46

0 Answers0