• Register
0 votes

Problem :

I am getting bellow in Android Studio

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

6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

0 votes


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:


9 7 4
38,600 points

Related questions

0 votes
1 answer 20 views
0 votes
1 answer 1.1K views
Problem : I want to print the list of values in ListView from the webpage. I have the following two permission <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> But I am troubled ... : No Network Security Config specified, using platform default I do not know what it means and how can I fix it.
asked Dec 9, 2019 alecxe 7.5k points
0 votes
1 answer 4 views
Problem: Please help me fix this dilemma: an error occurred while executing the command definition. see the inner exception for details
asked Apr 5 tuhin1 48.9k points
0 votes
1 answer 8 views
Problem: an error occurred while executing the command definition. see the inner exception for details.
asked Feb 23 Muneeb Saadii 130k points
0 votes
1 answer 691 views
Problem: I was trying to start the ionic 3 but if I try to run the command 'ionic cordova run android' then I was facing below error. I tried many ways to fix this problem but I was unable to fix it: > cordova run android [13:30:46]  lint finished ... are my System details: Node       : v6.11.0 OS         : Windows 7 Xcode      : not installed ios-deploy : not installed ios-sim    : not installed
asked Aug 15, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 21 views
0 votes
1 answer 433 views
Cannot create controller in thread that did not call Looper.prepare () What does the following exception mean? How can I fix it? Here is the code: Toast toast = Toast.makeText (mContext, "Something", Toast.LENGTH_SHORT); This is the exception: Java.lang.RuntimeException: Cannot ... :121)      on Android.widget.Toast. <init> (Toast.Java:68)      on Android.widget.Toast.makeText (Toast.Java:231)
asked Aug 17, 2020 game 4.6k points
0 votes
1 answer 79 views
Problem : I am getting bellow error while trying to run my android code. java.lang.runtimeexception: unable to start activity componentinfo
asked Nov 2, 2019 peterlaw 6.9k points
0 votes
2 answers 311 views
Problem : I was trying to run a sample code While launching the application in the android 1.5 emulator , I got bellow errors.... Any one have any hint ? java.lang.runtimeexception: unable to instantiate activity componentinfo
asked Oct 23, 2019 peterlaw 6.9k points