Home > Android > Android Program – Options Menu

Android Program – Options Menu

Android options menu java snippet download

ANDROID FOR FRESHER

Android Program Options Menu

 

Java Code(OptionAct)

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;

public class OptionAct extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_option);
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
super.onCreateOptionsMenu(menu);
MenuInflater mi = getMenuInflater();
mi.inflate(R.menu.menu_example1,menu);
return true;
}
public void view1(View v)
{
Intent i=new Intent(OptionAct.this,OptionNext.class);
startActivity(i);
}

}

Layout XML Code(activity_option)

<?xml version=”1.0″ encoding=”utf-8″?>
<LinearLayout 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:orientation=”vertical”
android:paddingBottom=”@dimen/activity_vertical_margin”
android:paddingLeft=”@dimen/activity_horizontal_margin”
android:paddingRight=”@dimen/activity_horizontal_margin”
android:paddingTop=”@dimen/activity_vertical_margin”
tools:context=”com.andro.tech.androidproject.OptionAct”>

<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:textSize=”30sp”
android:layout_gravity=”center”
android:textStyle=”bold”
android:text=”OPTIONS MENU”
android:layout_marginBottom=”280dp” />

<Button
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:text=”@string/sourcecode”
android:background=”@color/bgcolor”
android:textStyle=”bold”
android:textColor=”@color/text”
android:onClick=”view1″/>

</LinearLayout>

Output:

Android options menu java snippet download         Android options menu java snippet download

Android options menu java snippet download

Download Option Menu Android Source Code

For More Android Programs –Click Here

 

Follow Us – Never Miss Update

Fb/PageTwitterGoogle+InstagramPinterest 

 

Related search

Android options menu java snippet download, Android Menu option activity code download, android options menu code download, android menu option snippet download, android option menu snippet download, android option menu java snippet code download, android option menu snippet code for freshers, android options menu java snippet download

Is This Content Useful For You?