Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Android Example To Create Button

Hey, in this post you will get the code of Android Example To Create Button. I’m sharing this code because I think many of the beginner need to learn first how they declare button and how to used then by passing the id in java files.

activity_main.xml

 
MainActivity.java
package com.junaidshahid.buttonapp;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
 
public class MainActivity extends Activity {
 
	@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.main, menu);
		return true;
	}
}
 

The post Android Example To Create Button appeared first on Junaid Shahid | P-Blogger.



This post first appeared on Junaid Shahid | P-Blogger, please read the originial post: here

Share the post

Android Example To Create Button

×

Subscribe to Junaid Shahid | P-blogger

Get updates delivered right to your inbox!

Thank you for your subscription

×