Problem with LayoutInflater Android
<p>So here is my code in View. </p>

<pre><code>public class TheView extends View {
..
    public boolean onKeyDown(int keyCode, KeyEvent event){
    ....
     LayoutInflater inflater = this.game.getLayoutInflater();
     inflater.inflate(R.layout.status, null);
    ....
    }
}
</code></pre>

<p>And here is the xml file code which is named as "status.xml"</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;item   android:id="@+id/settings"
            android:title="@string/app_name"/&gt;
&lt;/menu&gt;   
</code></pre>

<p>"TheView" is called from another activity. And in the View i have drawn a canvas and have painted some graphics on top of it. I need to get a inflated menu on top of that. But when i try it with the given code it gives the following error</p>

<pre><code>04-10 20:05:27.090: ERROR/AndroidRuntime(2208): FATAL EXCEPTION: main
04-10 20:05:27.090: ERROR/AndroidRuntime(2208): android.view.InflateException: Binary XML file line #2: Error inflating class menu
04-10 20:05:27.090: ERROR/AndroidRuntime(2208):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
04-10 20:05:27.090: ERROR/AndroidRuntime(2208):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
04-10 20:05:27.090: ERROR/AndroidRuntime(2208):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
</code></pre>

<p>Any suggestions??? </p>
