• Register
0 votes
131 views

Problem :

I am getting bellow in Android Studio

java.lang.runtimeexception: an error occurred while executing doinbackground()

by (6.9k points)  

1 Answer

0 votes

Solution:

1.I think you must be running the AsyncTask as bellow which is not correct:

new MyAsyncTask().execute(); 

2.which clearly suggests that you are not passing any argument to it.

3.And in  doInBackground method you must be trying to get a value as bellow

 String newstr=args[0];

but args array has length 0.

So you are facing issue.

4. You need to start the AsycTask as bellow to resolve your issue:

new MyAsyncTask().execute(yqlURL);

Further Readings:

https://github.com/evernote/android-job/issues/255

by (36.1k points)  
edited by
...