Reputation: 55
I have an IntentService
which triggers a Dialog
box after an event of interest has occurred. But, each time the Dialog
box is launched, the MainActivity
of my app is launched in the background with the Dialog
box in the foreground. Dismissing the Dialog
gives the user access to the Activity
.
Is there a way to launch only the Dialog
without launching the MainActivity
in the background. I want it to be like the messaging app which shows a dialog for quick reply.
Thanks in advance.
Upvotes: 0
Views: 496
Reputation: 12191
Its not possible to launch a dialog without an activity's context.
However,
You can make an activity look and feel like a dialog by adding this theme in your manifest:
<activity
android:name="YourActivityThatLooksLikeADialog"
android:theme="@android:style/Theme.Dialog" />
Upvotes: 1