Monthly Archives: Luty 2011

Alert dialog problem

I can’t compile/run code below:

this.showAlert(„Alert Title”, 0, „Alert Content”, „Confirm Text”, false);

SOLUTION:

The solution is to use the following code in order to create alert dialog:

AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(„Alert Title”)
.setMessage(„Alert Content”)
.setCancelable(false)
.setPositiveButton(„Confirm Text”, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Action handling confirmation, in this case I simply  dismiss alert
dialog.dismiss();
}
});
builder.create().show();

Share this article

  • Blip
  • Delicious
  • Digg
  • Facebook
  • Grono
  • Kciuk
  • NK
  • Twitter
  • Wykop

android:textAlign layout attribute problem

SOLUTION:

Use

android:layout_gravity

attribute instead of

android:textAlign

Share this article

  • Blip
  • Delicious
  • Digg
  • Facebook
  • Grono
  • Kciuk
  • NK
  • Twitter
  • Wykop