23.07.2015 Views

Android Tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

});<br />

}<br />

int selected = radioGroupCricket.getCheckedRadioButtonId();<br />

radioBtn1 = (RadioButton) findViewById(selected);<br />

Toast.makeText(MainActivity.this,<br />

radioBtn1.getText(), Toast.LENGTH_SHORT).show();<br />

@Override<br />

public boolean onCreateOptionsMenu(Menu menu) {<br />

/* Inflate the menu; this adds items to the action bar if it<br />

is present */<br />

getMenuInflater().inflate(R.menu.main, menu);<br />

return true;<br />

}<br />

}<br />

Following will be the content of res/layout/activity_main.xml file:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

TUTORIALS POINT<br />

Simply Easy Learning

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!