OptionMenu layout bug when using Dialog theme?

by Daniel » Fri, 13 Mar 2009 15:06:22 GMT

Sponsored Links
I did an Android application which just has an AutoCompleteTextView.
The Activity containing the AutoCompleteTextView uses the Dialog theme
This Activity also has an options menu. But when you press the options
menu button the menu is displayed right below the AutoCompleteTextView
which is somewhere in the middle of the screen, not at the bottom.
I found no way to display the options menu at the bottom of the
screen. Is this a bug?

OptionMenu layout bug when using Dialog theme?

by Romain Guy » Fri, 13 Mar 2009 15:29:50 GMT

 Known bug which I think we fixed in Cupcake. Note that having a menu
for a dialog is very weird anyway.

Romain Guy
Android framework engineer

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them


Sponsored Links

OptionMenu layout bug when using Dialog theme?

by Daniel » Fri, 13 Mar 2009 15:40:40 GMT

 The AutoCompleteTextView is to build something like a desktop search
(Apps, Music, Contacts etc).
But I also need a way to jump into the settings dialog. Therefore I
need an options menu on a dialog style activity. Looks pretty nice ;-)


OptionMenu layout bug when using Dialog theme?

by Daniel » Fri, 13 Mar 2009 15:43:11 GMT

 still not fixed in Cupcake (03/03/2009). :-(


Other Threads

1. I'm Trying To Learn.......

I have an  issue with the basic structure that I can't seem to get
past.  I am using Eclipse and trying to run through the examples iin
Professional Android Application Development.  Here is my issue:

I have a project i setup in Eclipse.  Under it have have the usual
default setup.  I compile and run the default code just fine.  When I
try to edit the TodoListItemView source file I get an error in the
AndroidManifest.xml file in the project root.  Here is that file and
the <X>  in the code below is the issue. The error message is
"TDLIV.com.TodoListItemView does not extend android.app.Activity"

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="(deleted the http)schemas.android.com/apk/res/
    <application android:icon="@drawable/icon" android:label="@string/
        <activity android:name=".TodoListItemView"
<X>                android:label="@string/app_name">
                <action android:name="android.intent.action.MAIN" />
android:name="android.intent.category.LAUNCHER" />

So far, I am trying to do is start an example from the book.  That
code is as follows and shows no errors.
package TDLIV.com;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.TextView;
import android.app.Activity;
import android.os.Bundle;

public class TodoListItemView extends TextView {

      /** Constructors. Each should call init() */
      public TodoListItemView (Context context, AttributeSet attrs,
int defStyle) {
        super(context, attrs, defStyle);

      public TodoListItemView (Context context) {

      public TodoListItemView (Context context, AttributeSet attrs) {
        super(context, attrs);

      private void init() {


I am obviously a novice and would really appreciate anyones comments
greatly.  I used to do some java coding for fun but was not using

Thanks in advance for any help.



2. Psssing keys for each value in a list view to another view


 I have a  list view to list some categories. I need to list the
products under each category in a new list. I used arrayList to the
adapter, I am able to list the category names . but I cant pass the
keys (categoryIds) to the next view for getting the products.

Please help me in this regard.

For Now I am trying to display the categoryId in the produts page, but
i am not suceeding :(

the following is the code I tried

public class Categories extends ListActivity  {

        ArrayList CatList       ;
   protected void onCreate(Bundle savedInstanceState) {
       CatList= GetCategories(); // this returns an Array List
          setListAdapter(new ArrayAdapter<String>


   protected void onListItemClick(ListView l, View v, int position,
long id) {
//       Map map = (Map) l.getItemAtPosition(position);

     //  Intent intent = (Intent) map.get("intent");
    //   startActivity(intent);
          // super.onListItemClick(l, v, position, id);
       Intent i = new Intent(this, Products.class);
     //  startActivity(i);
       i.putExtra("categ",CatList.get(position).toString() );
        // setContentView(R.layout.products);
public static Arraylist GetCategories() {
                code to  get the array List
/// following is the products.java

public class Products extends ListActivity  {

   protected void onCreate(Bundle savedInstanceState) {
          TextView CategoryIdtext = (TextView) findViewById
      Bundle extras = getIntent().getExtras();


3. Starting new Activity vs. setContentPane(newView)

4. Standard widget styles

5. Fwd: Supported unicode characters

6. Ping website

7. potential medication applications