Home > DeveloperSection > Forums > Unfortunately my app has stop
nhel clamor
nhel clamor

Total Post:1

Points:7
Posted on    June-19-2015 3:35 AM

 Android Android 
Ratings:


 1 Reply(s)
 587  View(s)
Rate this:
guys, please help me with this, I am trying to create an email app without user interaction, I copied this code and follow everything they say, but my app always unfortunately stop.


06-19 05:59:03.072: E/AndroidRuntime(5479): FATAL EXCEPTION: AsyncTask #2

06-19 05:59:03.072: E/AndroidRuntime(5479): Process: com.example.disapp, PID: 5479

06-19 05:59:03.072: E/AndroidRuntime(5479): java.lang.RuntimeException: An error occured while executing doInBackground()

06-19 05:59:03.072: E/AndroidRuntime(5479): at android.os.AsyncTask$3.done(AsyncTask.java:300)

06-19 05:59:03.072: E/AndroidRuntime(5479): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)

06-19 05:59:03.072: E/AndroidRuntime(5479): at java.util.concurrent.FutureTask.setException(FutureTask.java:222)

06-19 05:59:03.072: E/AndroidRuntime(5479): at java.util.concurrent.FutureTask.run(FutureTask.java:242)

06-19 05:59:03.072: E/AndroidRuntime(5479): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)

06-19 05:59:03.072: E/AndroidRuntime(5479): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)

06-19 05:59:03.072: E/AndroidRuntime(5479): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)

06-19 05:59:03.072: E/AndroidRuntime(5479): at java.lang.Thread.run(Thread.java:841)

06-19 05:59:03.072: E/AndroidRuntime(5479): Caused by: java.lang.NoClassDefFoundError: javax.activation.DataHandler

06-19 05:59:03.072: E/AndroidRuntime(5479): at com.example.disapp.GMailSender.sendMail(GMailSender.java:59)

06-19 05:59:03.072: E/AndroidRuntime(5479): at com.example.disapp.Home$MyAsyncClass.doInBackground(Home.java:416)

06-19 05:59:03.072: E/AndroidRuntime(5479): at com.example.disapp.Home$MyAsyncClass.doInBackground(Home.java:1)

06-19 05:59:03.072: E/AndroidRuntime(5479): at android.os.AsyncTask$2.call(AsyncTask.java:288)

06-19 05:59:03.072: E/AndroidRuntime(5479): at java.util.concurrent.FutureTask.run(FutureTask.java:237)

06-19 05:59:03.072: E/AndroidRuntime(5479): ... 4 more

06-19 05:59:03.092: W/ActivityManager(373):   Force finishing activity com.example.disapp/.Home



Manoj Pandey

Total Post:26

Points:188
Posted on    June-22-2015 4:24 AM

  
 If you copied code from this link then you have need to some changes in your code and i have already changed my code you can see.
Remove toast from Void doInBackground(Void... mApi) 

You cannot show toast on doInBackground() method here 
  because there is dialog already running, you have need to remove toast from here and add on onPostExecute( ). 

  @Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
pDialog.cancel();
Toast.makeText(MainActivity.this, "Email send", Toast.LENGTH_LONG)
.show();
}


Modified On Jun-22-2015 04:25:08 AM

Don't want to miss updates? Please click the below button!

Follow MindStick