Tuesday, June 28, 2011

How to do them in View ?

16 June 2011
How to remove the button shape of an ImageButton ?
android:background="@null"

07 Sept 2010
How to create Full Screen activity ?

requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.xxx);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

16 Aug 2010
How to know about screen width and height ?

Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();

How to show an Alert ?

AlertDialog dialog = new AlertDialog.Builder(this)
.setMessage(R.string.message)
.setPositiveButton(R.string.yes,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
}
)
.setNegativeButton(R.string.no,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
}
).create();
dialog.show();

No comments:

Post a Comment