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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:04:40+00:00 2026-05-24T21:04:40+00:00

ERROR : The Application DialogSample has stopped unexpectedly.please try again. public class DialogSampleActivity extends

  • 0

ERROR : The Application DialogSample has stopped unexpectedly.please try again.

 public class DialogSampleActivity extends Activity {

    static final int DIALOG_PAUSED_ID = 0;
    static final int DIALOG_GAMEOVER_ID = 1;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);    

        Context mContext = getApplicationContext();
        Dialog dialog = new Dialog(mContext);

        dialog.setContentView(R.layout.custom_dialog);
        dialog.setTitle("Custom Dialog");

        TextView text = (TextView) dialog.findViewById(R.id.text);
        text.setText("Hello, this is a custom dialog!");
        Imenter code hereageView image = (ImageView) dialog.findViewById(R.id.image);
        image.setImageResource(R.drawable.android);

        dialog.show();

    }

   }

08-17 11:13:02.777: DEBUG/AndroidRuntime(594): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
08-17 11:13:02.787: DEBUG/AndroidRuntime(594): CheckJNI is ON
08-17 11:13:05.166: DEBUG/AndroidRuntime(594): Calling main entry com.android.commands.pm.Pm
08-17 11:13:05.277: DEBUG/AndroidRuntime(594): Shutting down VM
08-17 11:13:05.306: INFO/AndroidRuntime(594): NOTE: attach of thread 'Binder Thread #3' failed
08-17 11:13:05.327: DEBUG/dalvikvm(594): GC_CONCURRENT freed 100K, 72% free 296K/1024K, external 0K/0K, paused 9ms+20ms
08-17 11:13:05.327: DEBUG/jdwp(594): Got wake-up signal, bailing out of select
08-17 11:13:05.327: DEBUG/dalvikvm(594): Debugger has detached; object registry had 1 entries
08-17 11:13:06.377: DEBUG/AndroidRuntime(604): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
08-17 11:13:06.377: DEBUG/AndroidRuntime(604): CheckJNI is ON
08-17 11:13:08.217: DEBUG/AndroidRuntime(604): Calling main entry com.android.commands.am.Am
08-17 11:13:08.338: INFO/ActivityManager(103): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.DialogSample/.DialogSampleActivity } from pid 604
08-17 11:13:08.477: INFO/ActivityManager(103): Start proc com.DialogSample for activity com.DialogSample/.DialogSampleActivity: pid=612 uid=10037 gids={}
08-17 11:13:08.486: DEBUG/AndroidRuntime(604): Shutting down VM
08-17 11:13:08.548: INFO/AndroidRuntime(604): NOTE: attach of thread 'Binder Thread #3' failed
08-17 11:13:08.597: DEBUG/dalvikvm(604): GC_CONCURRENT freed 102K, 69% free 319K/1024K, external 0K/0K, paused 3ms+4ms
08-17 11:13:08.676: DEBUG/jdwp(604): Got wake-up signal, bailing out of select
08-17 11:13:08.676: DEBUG/dalvikvm(604): Debugger has detached; object registry had 1 entries
08-17 11:13:09.416: DEBUG/dalvikvm(33): GC_EXPLICIT freed 10K, 53% free 2537K/5379K, external 1625K/2137K, paused 828ms
08-17 11:13:09.676: DEBUG/dalvikvm(33): GC_EXPLICIT freed <1K, 53% free 2537K/5379K, external 1625K/2137K, paused 264ms
08-17 11:13:09.847: DEBUG/dalvikvm(33): GC_EXPLICIT freed <1K, 53% free 2537K/5379K, external 1625K/2137K, paused 162ms
08-17 11:13:12.127: DEBUG/dalvikvm(612): GC_EXTERNAL_ALLOC freed 53K, 53% free 2559K/5379K, external 1872K/2137K, paused 98ms
08-17 11:13:12.226: DEBUG/AndroidRuntime(612): Shutting down VM
08-17 11:13:12.226: WARN/dalvikvm(612): threadid=1: thread exiting with uncaught exception (group=0x40015560)
08-17 11:13:12.287: ERROR/AndroidRuntime(612): FATAL EXCEPTION: main
08-17 11:13:12.287: ERROR/AndroidRuntime(612): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.DialogSample/com.DialogSample.DialogSampleActivity}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at android.os.Looper.loop(Looper.java:123)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at android.app.ActivityThread.main(ActivityThread.java:3647)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at java.lang.reflect.Method.invokeNative(Native Method)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at java.lang.reflect.Method.invoke(Method.java:507)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at dalvik.system.NativeStart.main(Native Method)
08-17 11:13:12.287: ERROR/AndroidRuntime(612): Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:181)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at com.android.internal.app.AlertController.installContent(AlertController.java:199)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at android.app.AlertDialog.onCreate(AlertDialog.java:251)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at android.app.Dialog.dispatchOnCreate(Dialog.java:307)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at android.app.Dialog.show(Dialog.java:225)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at com.DialogSample.DialogSampleActivity.onCreate(DialogSampleActivity.java:41)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)
08-17 11:13:12.287: ERROR/AndroidRuntime(612):     ... 11 more
08-17 11:13:12.339: WARN/ActivityManager(103):   Force finishing activity com.DialogSample/.DialogSampleActivity
08-17 11:13:12.897: WARN/ActivityManager(103): Activity pause timeout for HistoryRecord{408aa0a8 com.DialogSample/.DialogSampleActivity}
08-17 11:13:24.800: WARN/ActivityManager(103): Activity destroy timeout for HistoryRecord{408aa0a8 com.DialogSample/.DialogSampleActivity}
08-17 11:13:29.808: INFO/Process(612): Sending signal. PID: 612 SIG: 9
08-17 11:13:29.927: WARN/InputManagerService(103): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40831b48
08-17 11:13:30.716: INFO/ActivityManager(103): Process com.DialogSample (pid 612) has died.

this was the logcat for the previous code

  • 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-24T21:04:41+00:00Added an answer on May 24, 2026 at 9:04 pm

    try this:

    private AlertDialog show(){
                LayoutInflater inflator = LayoutInflater.from(mContext);
                View view = inflator.inflate(R.layout.custom_dialog, null);
                TextView text = (TextView) view.findViewById(R.id.text);
                text.setText("Hello, this is a custom dialog!");
                ImageView image = (ImageView) view.findViewById(R.id.image);
                image.setImageResource(R.drawable.android);
    
    
                return new AlertDialog.Builder(Search.this)
                .setView(view)
                .setTitle("Custom Dialog")
                .show();
            }
    

    call this function from your code and it will show the dialog….It is working at my end.

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

Sidebar

Related Questions

Fatal error: Class 'Application_Model_News' not found in C:\xampp\htdocs\testZend\application\controllers\IndexController.php on line 14 i cannot connect
Download file already success but when install it has an error application-not-installed I already
I'm getting an error when my application starts. It appears to be after it's
All throughout an application wherever error messages (or other user messages) are used I
Unlike this question: Linker Error while building application using Boost Asio in Visual Studio
I get this error when trying to load a Zend Framework application: Fatal error:
In what situations should one catch java.lang.Error on an application?
I signed the application and trying to install on Nokia 5000 giving error Application
gcc lovingly throws me this error: bst.c:33: error: invalid application of ‘sizeof’ to incomplete
My data_site.wsgi file: import main application = application() Error i get at apache: [Thu

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.