[android-developers] Two methods of dialogs button tuning. What the difference

2011-01-28 Thread Aevea
There is two methors to add buttons to AlertDialog 1. using AlertDialog.Builder and calling builder.setPositiveButton or setNegativeButton 2. using AlertDialog dialog; dialog.setButton dialog.setButton2. What the difference By the way, if I inherit my class from Dialog should I override all

[android-developers] How to set view position on parent

2011-01-18 Thread Aevea
Hello to everybody. Here is my problem: In my android application I need to use custom menu. In xml I make menu layout (RelativLayout) and inflate it on application start, then add it to parent layout, which was set by setContentView(). So I have something like this: private void initMenu()

[android-developers] Problem with layout_gravity.

2011-01-18 Thread Aevea
In my main.xml layout_gravity works normally with LinearLayout and when you use setContentView(R.layout.main); But if I inflate this xml file and then add it on screen using addContentView or addView layout_gravity stops work - content of main.xml draw in top position of screen. Here is the code: