1

In an recent stackoverflow post, I commented that I have a library class called HttpPostAux.java.

It works when I call it from Main.java (main activity) to validate user login (here I use an AsyncTask thread to connect to server). But when I use it to replace old password in case user has forgotten it (here I use another AsyncTask thread to connect to server), it gives me an error:

An error occurred while executing doInBackground() ... Caused by: java.lang.NullPointerException

But when I look for that null, surprise: I didn't find it! And in my humble opinion, this error shouldn't exist because HttpPostAux isn't attached to any activity in particular.

Can anybody help me here? Which is the correct way to use different AsyncTask threads in different activities? I would publish some code, but I'm out of time right now...

Thanks in advance!

Community
  • 1
  • 1
alois.wirkes
  • 369
  • 2
  • 7
  • 20

1 Answers1

0

if you are using httpurlconnection this is not good in lower api's see this link http://android-developers.blogspot.com/2011_09_01_archive.html

Yousef Zakher
  • 1,634
  • 15
  • 18