As i know you can not create Dialogs from a Service. The Service is
for running in the backgound, not for interact with the user. But you
can create Toaster and Notification from the service. Another solution
is to start an Activity from you Service (you can use a Dialog like
team on the Activity, so it will look like a Dialog) and put the users
answer back to the Service by an Intent. (Or with a Binder).

Check out the Local Service example:
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/LocalServiceActivities.html

On 14 February 2011 17:07, sonika <[email protected]> wrote:
> I want to create dialog box inside service.If i put service as a part
> of system server process, dialog creation happens perfectly well with
> system server context.Everything works fine.
> But i want to run my service in a separate process.I extened my
> service from service class , dialog creation is failing.
> If i pass service context or applicaiton context during dialog
> creation.
> I wanted to understand the reason behind it.Why dialog works well in
> system server, not working when service is running in separate
> process.
> Which context actually dialog is looking for ?
> Any help will be really appreciated.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to