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 8025209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:05:31+00:00 2026-06-04T23:05:31+00:00

E/AndroidRuntime(16172): FATAL EXCEPTION: main E/AndroidRuntime(16172): java.lang.IllegalArgumentException: no dialog with id 2 was ever shown

  • 0
E/AndroidRuntime(16172): FATAL EXCEPTION: main
E/AndroidRuntime(16172): java.lang.IllegalArgumentException: no dialog with id 2 was ever shown via Activity#showDialog
E/AndroidRuntime(16172):        at android.app.Activity.missingDialog(Activity.java:2600)
E/AndroidRuntime(16172):        at android.app.Activity.dismissDialog(Activity.java:2585)
E/AndroidRuntime(16172):        at com.proapps.eng.android.client.meeting_screen$1.handleMessage(meeting_screen.java:196)
E/AndroidRuntime(16172):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(16172):        at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime(16172):        at android.app.ActivityThread.main(ActivityThread.java:3701)
E/AndroidRuntime(16172):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(16172):        at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(16172):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
E/AndroidRuntime(16172):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
E/AndroidRuntime(16172):        at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(  238):   Force finishing activity com.proapps.eng.android.client/.MainScreenActivity
W/ActivityManager(  238): Activity pause timeout for HistoryRecord{2b54bd38 com.proapps.eng.android.client/.MainScreenActivity}

This exception is thrown after Toast.show() and right after that,start a new activity (the main one) instead of finish() the current.

final Handler handler = new Handler() {
    public void handleMessage(Message msg) {
        // Get the current value of the variable total from the message data
        // and update the progress bar.
        int total = msg.getData().getInt("total");
        progDialog.setProgress(total);
        if (total <= 0){
            dismissDialog(typeBar);
            progThread.setState(ProgressThread.DONE);
            mail_sent_popup.show(); // mail sent popup
            startActivity(new Intent(cntx,MainScreenActivity.class));      
        // start the main instead of finishing this one.
        }
    }
}; 

When passing to the new activity it ‘forgets’ that the dialog was introduced in previous activity. What should I do?

BTW its not always throws ,only from time to time.
Thanx!!!

EDIT : Some more code (of the dialog thread)

private class ProgressThread extends Thread {

    // Class constants defining state of the thread
    final static int DONE = 0;
    final static int RUNNING = 1;

    Handler mHandler;
    int mState;
    int total;


    EditText name_text = (EditText)findViewById(R.id.editText1);
    EditText phone_text = (EditText)findViewById(R.id.editText2);
    EditText free_text = (EditText)findViewById(R.id.editText3);

    // Constructor with an argument that specifies Handler on main thread
    // to which messages will be sent by this thread.

    ProgressThread(Handler h) {
        mHandler = h;
    }

    // Override the run() method that will be invoked automatically when 
    // the Thread starts.  Do the work required to update the progress bar on this
    // thread but send a message to the Handler on the main UI thread to actually
    // change the visual representation of the progress. In this example we count
    // the index total down to zero, so the horizontal progress bar will start full and
    // count down.

    @Override
    public void run() {
        mState = RUNNING;   
        total = maxBarValue;
        while (mState == RUNNING) {

                // LONG JOB HERE

                }

            Message msg = mHandler.obtainMessage();
            Bundle b = new Bundle();
            b.putInt("total", 0);
            msg.setData(b);
            mHandler.sendMessage(msg);

        }
    }

    // Set current state of thread (use state=ProgressThread.DONE to stop thread)
    public void setState(int state) {
        mState = state;
    }
}

I guess dismissDialog(typeBar); is the wrong method to stop this thread. I don’t know where I should put state=ProgressThread.DONE in the code

EDIT2:

I’ve added the code that declares the dialog and parts of onCreate of the Activity:

public void onCreate(Bundle savedInstanceState) {
    ...
    ...
    showDialog(2);
    ...
}


    @Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case DATE_DIALOG_ID:
        return new DatePickerDialog(this, mDateSetListener, mYear, mMonth,mDay);
    case TIME_DIALOG_ID:
        return new TimePickerDialog(this, mTimeSetListener, mHour, mMinute,false);
    case 2:
        progDialog = new ProgressDialog(this);
        progDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        progDialog.setMessage("Sending...");
        progThread = new ProgressThread(handler);
        progThread.start();
        return progDialog;
    }
    return null;
}
  • 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-06-04T23:05:33+00:00Added an answer on June 4, 2026 at 11:05 pm

    this is how i’ve solved this issue:

        final Handler handler = new Handler() {
        public void handleMessage(Message msg) {
            // Get the current value of the variable total from the message data
            // and update the progress bar.
            int total = msg.getData().getInt("total");
            progDialog.setProgress(total);
            if (total <= 0){
                progThread.setState(ProgressThread.DONE);
    //          dismissDialog(typeBar);     // PROBLEMATIC
                mail_sent_popup.show(); // mail sent popup
                startActivity(new Intent(cntx,MainScreenActivity.class));
    // start the main instead of finishing this one.
            }
        }
    };
    

    Just commented the manual dismissDialog and let the thread die with progThread.setState(ProgressThread.DONE);
    hope this helps somebody.

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

Sidebar

Related Questions

E/AndroidRuntime(2886): FATAL EXCEPTION: main E/AndroidRuntime(2886): java.lang.NullPointerException E/AndroidRuntime(2886): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:394) E/AndroidRuntime(2886): at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362) E/AndroidRuntime(2886): at
New to android programming. Getting Following error. 04-07 14:49:05.452: ERROR/AndroidRuntime(1566): FATAL EXCEPTION: main java.lang.OutOfMemoryError
12-19 18:29:33.203: ERROR/AndroidRuntime(402): FATAL EXCEPTION: main 12-19 18:29:33.203: ERROR/AndroidRuntime(402): java.lang.RuntimeException: Unable to start activity
The logcat error: 08-24 11:16:19.760: ERROR/AndroidRuntime(6254): FATAL EXCEPTION: main 08-24 11:16:19.760: ERROR/AndroidRuntime(6254): java.lang.RuntimeException: Unable
FATAL EXCEPTION E/AndroidRuntime(535): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.This.Calculator/com.This.Calculator.BatteryCalculatorActivity}: java.lang.ClassNotFoundException: com.This.Calculator.ThisBatteryCalculatorActivity I was just
04-25 14:16:30.931: E/AndroidRuntime(6638): FATAL EXCEPTION: main 04-25 14:16:30.931: E/AndroidRuntime(6638): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null,
Here is the stacktrace: 04-10 18:09:36.393: E/AndroidRuntime(26592): FATAL EXCEPTION: main 04-10 18:09:36.393: E/AndroidRuntime(26592): java.lang.RuntimeException:
01-26 20:45:50.841: E/AndroidRuntime(327): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.demo.app/com.demo.app.Sencha_demoActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x0 01-26
Why do I get this Exception? 05-18 20:29:38.044: ERROR/AndroidRuntime(5453): java.lang.IllegalArgumentException: The key must be
I got this exception 01-03 00:28:43.465 E/AndroidRuntime(13556): java.lang.NoSuchMethodError: android.content.pm.PackageManager.currentToCanonicalPackageNames 01-03 00:28:43.465 E/AndroidRuntime(13556): at com.android.DL_launcher.LauncherProvider$DatabaseHelper.addAppShortcut(LauncherProvider.java:632)

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.