View Full Version : Android Programming

02-26-2012, 12:25 PM
Im having a problem with my Android applet I am creating using a program called Eclipse

It reads the error:
'The method onCreateOptionsMenu(Menu) in the type Activity is not applicable for the arguments (Menu)'.

Here is what I have written:

[code] public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater awesome = getMenuInflater();
awesome.inflate(R.menu.main_menu, menu);
return true;
} [code]

Philip M
02-26-2012, 01:07 PM
This is the JavaScript forum. Java and Javascript are entirely different programming languages, in spite of the confusingly similar names. Rather like Austria and Australia!

Ask a mod to move you over to the right forum.

It is your responsibility to die() if necessary….. - PHP Manual

02-26-2012, 10:54 PM
We will most likely need to see the Resources xml file as well- in addition the functions that are calling that- Also I think you will go into an infinite recursive loop there won't you?

public boolean onCreateOptionsMenu(Menu menu) {

it seems as though it will just keep calling itself over and over and over and ... etc...
as for the error message, debug and then see what datatype is being passed- if it is not a "menu" datatype then you need to convert it before calling...

03-05-2012, 10:46 AM
I think this is what is calling that and underneath is my xml programming

package com.edu4Java.adroid.tutorial1;

import android.app.Activity;
import android.os.Bundle;

public class sweet extends Activity {

protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub


and my xml file:

[code] <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

android:title="Open Sweet Activity"
android:title="Open Toast"

03-05-2012, 11:29 AM
This is what I am trying to create thank you so much for your input so far thank you :))


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum