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

  • Home
  • SEARCH
  • 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 7041323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:01:41+00:00 2026-05-28T02:01:41+00:00

I coded a Dialog that shows up with 2 textviews and 2 buttons. I

  • 0

I coded a Dialog that shows up with 2 textviews and 2 buttons.
I googled for that Problem as well but I didn’t find anything that mathced my issue.
Here is some Code:

case R.id.open:

          openDialog=new Dialog(this);
          openDialog.setContentView(R.layout.open_dialog);

          openDialog.setTitle(head);
          openDialog.setCancelable(true);

    Button open_cancel=(Button)findViewById(R.id.open_cancel);
          open_cancel.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                openDialog.cancel();
            }
        });

but I can’t show the dialog up with the buttons.
If I call it without these Lines there is no Problem:

    Button open_cancel=(Button)findViewById(R.id.open_cancel);
          open_cancel.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                openDialog.cancel();
            }
        });

This is the XML File:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/open_dialog"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:padding="10dp"
      >    
    <EditText android:id="@+id/open_head"
              android:layout_width="fill_parent"
              android:layout_height="50dp"
              android:text="ojfpojew ojr pojr"              
              />
    <EditText android:id="@+id/open_note"
              android:layout_width="fill_parent"
              android:text="oijpojepojpotjpotejpe ojtpojtpo ewpoj tpojt pp jpojtpoj etpoj poj poj t"
              android:layout_height="150dp"              
              />
    <Button android:id="@+id/open_edit"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="edit"
            />
    <Button android:id="@+id/open_cancel"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="cancel"
           />    
</LinearLayout>

I really do not understand why this not works…
here is the error log, if it helps:

01-05 16:43:51.004: D/dalvikvm(2336): GC freed 1010 objects / 70136 bytes in 75ms
01-05 16:43:51.204: D/dalvikvm(2336): GC freed 91 objects / 3664 bytes in 53ms
01-05 16:43:51.494: D/dalvikvm(2336): GC freed 132 objects / 6240 bytes in 62ms
01-05 16:43:51.674: D/dalvikvm(2336): GC freed 58 objects / 2312 bytes in 56ms
01-05 16:43:51.944: D/dalvikvm(2336): GC freed 147 objects / 9128 bytes in 63ms
01-05 16:43:52.383: D/ViewFlipper(2336): updateRunning() mVisible=true, mStarted=false, mUserPresent=true, mRunning=false
01-05 16:44:00.973: D/dalvikvm(2336): GC freed 25495 objects / 1393728 bytes in 88ms
01-05 16:44:02.644: D/dalvikvm(2336): GC freed 45722 objects / 2044568 bytes in 102ms
01-05 16:44:04.424: I/Resources(2336): Loaded time zone names for en in 1591ms.
01-05 16:44:06.834: D/dalvikvm(2336): GC freed 36788 objects / 1674624 bytes in 102ms
01-05 16:44:11.243: D/AndroidRuntime(2336): Shutting down VM
01-05 16:44:11.263: W/dalvikvm(2336): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
01-05 16:44:11.263: E/AndroidRuntime(2336): Uncaught handler: thread main exiting due to uncaught exception
01-05 16:44:11.273: E/AndroidRuntime(2336): java.lang.NullPointerException
01-05 16:44:11.273: E/AndroidRuntime(2336):     at producteev.push.Producteev_pushActivity.onContextItemSelected(Producteev_pushActivity.java:247)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at android.app.Activity.onMenuItemSelected(Activity.java:2174)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at com.android.internal.policy.impl.PhoneWindow$ContextMenuCallback.onMenuItemSelected(PhoneWindow.java:2731)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:139)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at com.android.internal.view.menu.MenuDialogHelper.onClick(MenuDialogHelper.java:129)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:884)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at android.widget.ListView.performItemClick(ListView.java)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at android.os.Handler.handleCallback(Handler.java:587)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at android.os.Handler.dispatchMessage(Handler.java:92)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at android.os.Looper.loop(Looper.java:123)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at android.app.ActivityThread.main(ActivityThread.java:4363)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at java.lang.reflect.Method.invokeNative(Native Method)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at java.lang.reflect.Method.invoke(Method.java:521)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
01-05 16:44:11.273: E/AndroidRuntime(2336):     at dalvik.system.NativeStart.main(Native Method)
01-05 16:44:11.293: I/dalvikvm(2336): threadid=7: reacting to signal 3
01-05 16:44:11.323: I/dalvikvm(2336): Wrote stack trace to '/data/anr/traces.txt'
01-05 16:44:13.383: I/Process(2336): Sending signal. PID: 2336 SIG: 9
  • 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-28T02:01:42+00:00Added an answer on May 28, 2026 at 2:01 am

    Try this,

    Button open_cancel=(Button)openDialog.findViewById(R.id.open_cancel); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom Dialog that shows a few buttons. The idea is to
I have a custom EditButton that shows a dialog for the user to select
I have a jQuery modal dialog with an iFrame in it that shows some
I'm using multiple textviews with onclick listeners that direct me to a TimePicker Dialog.
I'm creating a custom Spinner that shows a custom Dialog. For that, I created
i have a strange problem with jquery i have this div that shows messages
I've got two branches of code. 1 has a dialog box that the other
The following piece of code shows an Insert table dialog: Dialog d = WordApp.Dialogs[WdWordDialog.wdDialogTableInsertTable];
i want to display a dialog in my android application where certain TextViews in
There is a similar question on SO but i reckon my problem lies elsewhere

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.