Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 693133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:43:20+00:00 2026-05-14T02:43:20+00:00

I had try to implement the send me log feature into my apps but

  • 0

I had try to implement the send me log feature into my apps but I can’t get it right. Can anyone please help me with it? In the logcat, it shows the errors:

03-29 21:23:37.636: ERROR/AndroidRuntime(820): Uncaught handler: thread AsyncTask #1 exiting due to uncaught exception
03-29 21:23:37.726: ERROR/AndroidRuntime(820): java.lang.RuntimeException: An error occured while executing doInBackground()
03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at android.os.AsyncTask$3.done(AsyncTask.java:200)
03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234)
03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258)
03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.util.concurrent.FutureTask.run(FutureTask.java:122)
03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)
03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)
03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.lang.Thread.run(Thread.java:1058)
03-29 21:23:37.726: ERROR/AndroidRuntime(820): Caused by: java.lang.NullPointerException
03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at resonet.android.androidgallery.helloAndroid$CheckForceCloseTask.doInBackground(helloAndroid.java:1565)
03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at resonet.android.androidgallery.helloAndroid$CheckForceCloseTask.doInBackground(helloAndroid.java:1)
03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)
03-29 21:23:37.726: ERROR/AndroidRuntime(820):     ... 4 more

Here is my code:

public class helloAndroid extends Activity implements OnClickListener {

public static final int DIALOG_SEND_LOG = 345350;
protected static final int DIALOG_PROGRESS_COLLECTING_LOG = 3255;
protected static final int DIALOG_FAILED_TO_COLLECT_LOGS = 3535122;


private static final int DIALOG_REPORT_FORCE_CLOSE = 3535788;

 private LogCollector mLogCollector;

public void onCreate(Bundle savedInstanceState) {


requestWindowFeature(Window.FEATURE_NO_TITLE);

  Bundle b = this.getIntent().getExtras();
  s = b.getString("specialValue").trim();
  String xmlURL = "";

  CheckForceCloseTask task = new CheckForceCloseTask();
     task.execute();
    }
    private void throwException() {
  throw new NullPointerException();
 }

 @Override
 protected Dialog onCreateDialog(int id) {
  Dialog dialog = null;
  switch (id) {
  case DIALOG_SEND_LOG:
  case DIALOG_REPORT_FORCE_CLOSE:
   Builder builder = new AlertDialog.Builder(this);
   String message;
   if (id==DIALOG_SEND_LOG)
    message = "Do you want to send me your logs?";
   else 
    message = "It appears this app has been force-closed, do you want to report it to me?";
   builder.setTitle("Warning")
   .setIcon(android.R.drawable.ic_dialog_alert)
   .setMessage(message)
   .setPositiveButton("Yes", this)
   .setNegativeButton("No", this);
   dialog = builder.create();
   break;
  case DIALOG_PROGRESS_COLLECTING_LOG:
   ProgressDialog pd = new ProgressDialog(this);
   pd.setTitle("Progress");
   pd.setMessage("Collecting logs...");
   pd.setIndeterminate(true);
   dialog = pd;   
   break;
  case DIALOG_FAILED_TO_COLLECT_LOGS:
   builder = new AlertDialog.Builder(this);
   builder.setTitle("Error")
   .setMessage("Failed to collect logs.")
   .setNegativeButton("OK", null);
   dialog = builder.create();
  }
  return dialog;
 }

 class CheckForceCloseTask extends AsyncTask<Void, Void, Boolean> {
  @Override
  protected Boolean doInBackground(Void... params) {
   return mLogCollector.hasForceCloseHappened();
  }

  @Override
  protected void onPostExecute(Boolean result) {
   if (result) {
    showDialog(DIALOG_REPORT_FORCE_CLOSE);
   } else
    Toast.makeText(getApplicationContext(), "No force close detected.", Toast.LENGTH_LONG).show();
  }
 }

 public void onClick(DialogInterface dialog, int which) {
  switch (which) {
  case DialogInterface.BUTTON_POSITIVE:
   new AsyncTask<Void, Void, Boolean>() {
    @Override
    protected Boolean doInBackground(Void... params) {
     return mLogCollector.collect();
    }
    @Override
    protected void onPreExecute() {
     showDialog(DIALOG_PROGRESS_COLLECTING_LOG);
    }
    @Override
    protected void onPostExecute(Boolean result) {
     dismissDialog(DIALOG_PROGRESS_COLLECTING_LOG);
     if (result)
      mLogCollector.sendLog("lintonye@gmail.com", "Error Log", "Preface\nPreface line 2");
     else
      showDialog(DIALOG_FAILED_TO_COLLECT_LOGS);
    }

   }.execute();
  }
  dialog.dismiss();
 }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:43:21+00:00Added an answer on May 14, 2026 at 2:43 am

    The problem is that mLogCollector is never initialized so it is always null. This is giving you a NullPointerException in doInBackground.

    You can see this in the stacktrace:

    Caused by: java.lang.NullPointerException
      at resonet.android.androidgallery.helloAndroid$CheckForceCloseTask.doInBackground(helloAndroid.java:1565)
    

    If you read the usage section of the documentation for android-send-me-logs, one of the first things it says in big bold letters is:

    Instantiate LogCollector

    LogCollector collector = new LogCollector(context);
    

    You need to do this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm terrible with regex, but I've had a try and a Google (and even
I had to delete all the rows from a log table that contained about
I had some time and decided to implement a one time pad just for
i want to implement a Drag/Drop mechanic in WPF, but it didn't work... With
I've previously post my question here but I didn't get any reply cause -
I had set up hibernate plugin to NetBeans and can not connect to MySQL
I'm trying to implement basic auditing for a system where users can login, change
Had an interesting discussion with some colleagues about the best scheduling strategies for realtime
Had a coworker ask me this, and in my brain befuddled state I didn't
I had used Server Explorer and related tools for graphical database development with Microsoft

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.