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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:36:07+00:00 2026-05-26T17:36:07+00:00

everybody Recently I have use ADT to develop the android 2.2 program. The program

  • 0

everybody

Recently I have use ADT to develop the android 2.2 program. The program run correctly in the simulator, but it meet a strange problem when it run in the real machine.

I use BaseAdapter to create a MenuAdapter, it will load the custom class called ViewHolder. Both the custom class and MenuAdapter is similar to any sample about BaseAdapter: ViewHolder only have two variable text and image, without any codes. MenuAdapter load the Menu layout that contain a TextView. It will assign the text variable in the TextView and load it as Alert Dialog repeatly.

Then I create array carry the following variable:

public String[] menuOptions={"Browser", "Google Map", "Camera", "Gallery", "Media Player", "Cancel", "Exit"};

After then, I use the AlertDialog.Builder().setAdapter() to create the BaseAdapter object and load the array in. The Alert Dialog carry on the data set. But it output this:

Browser, Google Map, Camera, Gallery, Media Player, Cancel, Browser

The last item change in random, I load the Alert Dialog again and it can turn out this:

Browser, Google Map, Camera, Gallery, Media Player, Cancel, Google Map

Browser, Google Map, Camera, Gallery, Media Player, Cancel, Gallery

no Exit…

So I want to know, what is going on? Why it does not load all the data? When I meet this problem, I try to reduce the Array to

public String[] menuOptions={"Browser", "Google Map", "Camera", "Gallery", "Media Player", "Cancel"};

It display correctly:

Browser, Google Map, Camera, Gallery, Media Player, Cancel

There is no numeric setting about the array loading in the MenuAdapter Class, so I don’t understand about this.

  • 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-26T17:36:07+00:00Added an answer on May 26, 2026 at 5:36 pm

    I have found the answer.

    The Dialog Alert display in wrong data because some of the data is displayed outside the screen. Dialog alert will display them in scroll-y style (if you know what HTML and CSS is then you will know what I mean).

    The data that hides in the scroll-y style will display in random……for example, my last item “Exit” is hide under the screen when I load in, I drag down the screen to review, it will display the last data in random, not “Exit”.

    I solve it in changing the line height of each items, make them shorter, make them display in one screen without scroll-y style and it will display the data correctly.

    I don’t know if it is system bug or not.

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

Sidebar

Related Questions

Everybody out there, I'm writing a c code which have a strange problem when
everybody; I have this problem in asp.net, I have a page where I insert
I recently joined a company where they use TDD, but it's still not clear
everybody, I am facing a weird problem in mac osx. I have installed eclipse(Indigo
I'm teaching myself VB.Net. Here is a problem I have recently come across. Say
Recently scalaz caught my eye. It looks very interesting, but I have not found
Hello Everybody, I was searching Android multitouch (pinch zoom) in so many sites but
Hi everybody. The problem: elcipse-3.5.0 (Galileo) spits with an error when I try to
Greetings everybody. I have seen examples of such operations for so many times that
Hey everybody, this is what I have going on. I have two text files.

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.