Android – i want to see the dialog in Top of layout. How to move it

androidsdk

All,

1.) I have a Dialog showing on my application. Right now it is showing in the center of the device. But i want to see that dialog in Top of layout. How to move it?

2.) How to add an image in a Dialog box?

EDIT: I added an image in background of Button. I want to move this button into right corner of Pop up Dialog. How to do that? And also i want to know how to move the entire Pop up Dialog itself into Top of the Layout screen?
As i'm new to this development, please some one suggest me how do i achieve this?

EDIT:
CAN SOME ONE TELL ME HOW TO MAKE THREE CONTROLS IN A SINGLE LINE USING LAYOUT? I WANT TO SHOW AN IMABE, A BUTTON AND TEXT LABEL IN A SINGLE LINE. I TRIED THAT ON LAYOUT IN ECLIPSE. BUT IT ACCEPTS ONLY ONE CONTROL FOR ONE LINE, IF ADD NEXT CONTROL IT GOES TO NEXT LINE(ROW). I WANT TO MAKE THREE CONTROLS TO BE IN SINGLE LINE. HOW DO I ACHIEVE THIS?

Best Answer

I am not aware of an API to change the position of a dialog. You may be better served creating an activity and using android:theme="@android:style/Theme.Dialog" to make it look like a dialog.

If you go that route, you will then be able to use all of the standard techniques for placing widgets (e.g., images) wherever you like.