<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>android menu Archives -</title>
	<atom:link href="https://mitindia.in/tag/android-menu/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/android-menu/</link>
	<description></description>
	<lastBuildDate>Mon, 11 Jul 2016 11:37:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://mitindia.in/wp-content/uploads/2023/03/cropped-android-chrome-512x512-1-32x32.png</url>
	<title>android menu Archives -</title>
	<link>https://mitindia.in/tag/android-menu/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Android Simple Menu Application</title>
		<link>https://mitindia.in/android-simple-menu-application/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Tue, 28 Jun 2016 06:11:16 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android menu]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=169</guid>

					<description><![CDATA[<p>Menu application using Android Following example shows that how to create menu application using Android. Follow the below steps to create. a) copy the following code to &#8220;activity_main.xml&#8221; &#60;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"&#62; &#60;TextView android:text="@string/hello_world" android:layout_width="wrap_content" android:layout_height="wrap_content" /&#62; &#60;ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/save" android:layout_centerInParent="true"/&#62; &#60;/RelativeLayout&#62; b) Now copy the follwoing code [&#8230;]</p>
<p>The post <a href="https://mitindia.in/android-simple-menu-application/">Android Simple Menu Application</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Menu application using Android</h3>
<p>Following example shows that how to create menu application using Android. Follow the below steps to create.</p>
<p><b>a) copy the following code to &#8220;activity_main.xml&#8221;</b></p>
<pre>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"&gt;

    &lt;TextView android:text="@string/hello_world" android:layout_width="wrap_content"
        android:layout_height="wrap_content" /&gt;

    &lt;ImageView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/save"
        android:layout_centerInParent="true"/&gt;


&lt;/RelativeLayout&gt;

<b>b) Now copy the follwoing code to "Main_Menu.xml" file</b>

&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"&gt;



    &lt;item android:id="@+id/item1"
        android:title="Item1"/&gt;

    &lt;item android:id="@+id/item2"
        android:title="Item2"/&gt;

    &lt;item android:id="@+id/item3"
        android:title="Item3"/&gt;


&lt;/menu&gt;

<b>c) Now, </b><b>copy the following code to "Main_Activity.java"</b>

package app.mitindia.com.menuapp;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;


public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        switch(item.getItemId())
        {
            case R.id.item1:
                Toast.makeText(getApplicationContext(),"Item 1 selected", Toast.LENGTH_LONG).show();
                return true;


            case R.id.item2:
                Toast.makeText(getApplicationContext(),"Item 2 selected", Toast.LENGTH_LONG).show();
                return true;

            case R.id.item3:
                Toast.makeText(getApplicationContext(),"Item 3 selected", Toast.LENGTH_LONG).show();
                return true;

default:
    return super.onOptionsItemSelected(item);


        }

    }
}</pre>
<pre>2) Run your application and observe the following output.</pre>
<p><img fetchpriority="high" decoding="async" class="alignnone" src="https://shivkblog.files.wordpress.com/2015/06/screenshot_2015-06-29-14-10-33.png?w=169" alt="Screenshot_2015-06-29-14-10-33" width="169" height="300" /></p>
<p>&nbsp;</p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fandroid-simple-menu-application%2F&amp;linkname=Android%20Simple%20Menu%20Application" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fandroid-simple-menu-application%2F&amp;linkname=Android%20Simple%20Menu%20Application" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fandroid-simple-menu-application%2F&#038;title=Android%20Simple%20Menu%20Application" data-a2a-url="https://mitindia.in/android-simple-menu-application/" data-a2a-title="Android Simple Menu Application"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/android-simple-menu-application/">Android Simple Menu Application</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
