UNFORTUNATELY MY APP HAS STOP

nhel clamor

Total Post:1

Points:7
Posted by  nhel clamor
 927  View(s)
Ratings:
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

  1. Manoj Pandey

    Post:26

    Points:188
    Re: Unfortunately my app has stop

      

     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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!