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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:37:41+00:00 2026-06-05T06:37:41+00:00

As you can see, below the bottom list element in my ListView, there is

  • 0

As you can see, below the bottom list element in my ListView, there is excess space I can’t seem to be rid of. I’ve tried Relative and Linearlayout, both look like this. Here’s the code:
enter image description here

public class ChooseDialog extends DialogFragment implements
        DialogInterface.OnClickListener {

    String URLhome;
    String Title;
    String type;

/*  public static ChooseDialog newInstance() {
        ChooseDialog dialog = new ChooseDialog();
        Log.v("a", "shit runs");
        Bundle bundle = new Bundle();
        dialog.setArguments(bundle);
        return dialog;
    }*/

    public ChooseDialog(String type) {
        this.type = type;
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setCancelable(true);
        int style = DialogFragment.STYLE_NORMAL, theme = 0;
        setStyle(style, theme);
    }

     @Override
        public Dialog onCreateDialog(Bundle savedInstanceState) {
            AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
            builder.setTitle(type);
            builder.setNegativeButton("Cancel", this);
            LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            View dialogLayout = inflater.inflate(R.layout.dialog, null);
            builder.setView(dialogLayout);

            final String[] items = {"Red", "Green", "Blue" };

            builder.setAdapter(new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, items), 
                    new DialogInterface.OnClickListener() {


                public void onClick(DialogInterface dialog, int which) {
                    Log.v("touched: ", items[which].toString());

                }} 
                );


            return builder.create();

        }

    @Override
    public void onClick(DialogInterface dialog, int which) {
        // TODO Auto-generated method stub

    }

}

And the code that launches the dialog:

public OnClickListener listener = new OnClickListener() {
    public void onClick(View v) {
        showNationalityDialog();
    }
};

private void showNationalityDialog() {
    FragmentManager fm = getSupportFragmentManager();
    ChooseDialog nationalityDialog = new ChooseDialog("Nationality");

    nationalityDialog.show(fm, "fragment_edit_name");
}
  • 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-05T06:37:42+00:00Added an answer on June 5, 2026 at 6:37 am

    I know this question never drew much attention, but I finally solved the problem.

    By using the listview that I created in XML rather than setting the builder’s adapter, I managed to get rid of all the excess space.

    Here’s what the new code looks like:

        switch (editText.getId()) {
        case (0) :
        ListView list = (ListView) dialogLayout.findViewById(R.id.listView1);
        list.setAdapter(new ArrayAdapter<String>(activity, R.layout.dialoglist, 
                activity.getResources().getStringArray(R.array.ageArray)));
        list.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                    long arg3) {
                editText.setText(activity.getResources().getStringArray(R.array.ageArray)[arg2]);
                dismiss();
            }   
        });
        builder = (Integer.parseInt(android.os.Build.VERSION.SDK) < 11)? new AlertDialog.Builder(activity) : 
            new AlertDialog.Builder(activity, android.R.style.Theme_Translucent);
        builder.setNegativeButton("Cancel", this);
        builder.setView(dialogLayout);
    
        return builder.create();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As you can see below, I have Parallel.For loop. If run the program while
I'm using graphviz (dot) to generate the graph you can see below. The node
I have two async classes in my application which you can see below class
i have a pretty complicated form. as you can see below: alt text http://img9.imageshack.us/img9/2465/test2xk.jpg
Trying not to lose it here. As you can see below I have assigned
as you can see the class below declares 2 private instance variables and 2
Hi below link from Vaadin you can see how to set checkboxes on tabletree,
How can I define a width for the label Quantity (see below)? I would
Screenshots Below. As you can see, my menubutton is showing up in the actionBar's
I have a SOAP message (see below). Using Xpath, how can I extract the

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.