I want to use an activity as dialog
and i made the theme of the activity as dialog & i succeed.
but
i have the problem here is when i click outside of the activity
its automatically get closed & the previous activity get started..
i tried a thing to make transparent parent layout it does not look like a dialog..
i want to use this activity to create new account in my application as it has only 3 fields so in tablet it looks large space unused... so i want to use activity as dialog.....
thenx in advance...!!! examples will be appreciated..!!!!!
Using Same Activity in Mobile devices and Tablets.
Mobile :-
styles.xml :-
Tablet :- Launch activity as dialog.
styles.xml :-
Manifest.xml :-
For the issue of avoiding closing the activity when clicking outside window from API 11 as mentioned by Vivek use this.setFinishOnTouchOutside(false);
but for prior APIs use this code:
Make change in code as per your need.
Thanks
if you haven't already tried it, then this is the way to achieve activity as dialog: in your manifest file, add to your activity the following attribute:
to Start activity as dialog I defined:
Now when I
startActivity()
it displays like a dialog and parent activity displays behind it. I want a Button which when clicked Dialog gets dismissed and parent activity should display without refreshing the page.Create an activity as we usually create it.
Also check CustomDialogActivity.java on android.com
I think you should create activity as a dialog, it helps.
This way, you can set style and theme for your activity.
try with following property