Problem with overflow menù

Put your problem here if it does not fit any of the other categories.

Problem with overflow menù

Postby Paolo86 » Tue Jan 08, 2013 5:35 pm

Hi, I have a problem with an overflow menù, one year ago I developed an application and works fine on my htc hero where there was an hardware menù button.
Last week I changed my device (nexus) and Jelly bean shows me the overflow menù in the top-right corner of the aplication but I cant'see my old menù-voices.
If i tap the overlow I can see only the main activity menù (auto created by eclipse with the dummy voice "settings" ) that extends a tabactivity.
Can someone help me please?

here is the code of the main activity:
Code: Select all
public class MainActivity extends TabActivity {

    @SuppressWarnings("deprecation")
        @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
   
        TabHost tabHost = getTabHost();
       
        // Tab for Photos
        TabSpec photospec = tabHost.newTabSpec("Inserisci");
        // setting Title and Icon for the Tab
        photospec.setIndicator("Inserisci", getResources().getDrawable(R.drawable.inserimento));
        Intent photosIntent = new Intent(this, Inserimento.class);
        photospec.setContent(photosIntent);

        // Tab for Songs
        TabSpec songspec = tabHost.newTabSpec("Prezzi");
        songspec.setIndicator("Prezzi", getResources().getDrawable(R.drawable.prezzi));
        Intent songsIntent = new Intent(this, Prezzi.class);
        songspec.setContent(songsIntent);

        // Tab for Videos
        TabSpec videospec = tabHost.newTabSpec("Cerca");
        videospec.setIndicator("Cerca", getResources().getDrawable(R.drawable.visualizza));
        Intent videosIntent = new Intent(this, Visualizza.class);
        videospec.setContent(videosIntent);

        // Adding all TabSpec to TabHost
        tabHost.addTab(photospec); // Adding photos tab
        tabHost.addTab(songspec); // Adding songs tab
        tabHost.addTab(videospec); // Adding videos tab
     }
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }


and this is the other class where I have the munù voices that I don't see anymore

Code: Select all
public class Visualizza extends FragmentActivity implements AlertDialogFragment.NoticeDialogListener,Data2.OnMyListFragmentItemClick
{
private GregorianCalendar calendar;
         private int mese,anno;
       
       
         private static final int MENUITEM_COMANDO_1 = 1;
         private static final int MENUITEM_COMANDO_2 = 2;
         private static final int MENUITEM_COMANDO_3 = 3;
         private static final int MENUITEM_COMANDO_4 = 4;
         
         
         
         private static Database databaseHelper;
         private static SQLiteDatabase db;
         private DialogFragment alertDialog;
         private ListView listView;
         
         private DialogFragment newFragment;
         
       
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_visualizza);
        listView = (ListView) findViewById(R.id.arrayList);
        calendar = new GregorianCalendar();
        databaseHelper = new Database (this);
        registerForContextMenu(listView);
       
       
    }

   
    public void onResume()
    {
     super.onResume();
     getData();
     visualizzaQuestoMese();
    }
   
   
   
   
   
           
           
           
    public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo)
    {
        super.onCreateContextMenu(menu, v, menuInfo);
        menu.setHeaderTitle(R.string.titleMenu);
        menu.add(0, DELETE_ID, 0, "Cancella");
    }
   
   
   
    public boolean onContextItemSelected(MenuItem item)
    {
        switch(item.getItemId()) {
            case DELETE_ID:
                AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
                db = databaseHelper.getReadableDatabase();
               
                databaseHelper.deleteNote(getIdToDelete(info.id), db);
                db.close();
                visualizzaQuestoMese();
                return true;
        }
        return super.onContextItemSelected(item);
    }
   
   
   
    public boolean onCreateOptionMenu(Menu menu) {
       
        super.onCreateOptionsMenu(menu);
        menu.add(Menu.NONE, MENUITEM_COMANDO_1, 1, this.getResources().getString(R.string.visualizzaTutto));
                menu.add(Menu.NONE, MENUITEM_COMANDO_2, 2, this.getResources().getString(R.string.scegliMese));
            menu.add(Menu.NONE, MENUITEM_COMANDO_4, 4,this.getResources().getString(R.string.calcolaSpese));
               
        return true;
    }
}


I hope that my english is good enough
thank you in advance
Paolo86
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Jan 08, 2013 5:15 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 32 guests