Thanks very much for Mark Murphy's answers.

Mark Murphy  wrote:
> andrew wrote:
> > I am sorry for using the wrong word "endless".
> > My service is a listener,when receiving messages from computer,
> > it will call my activity,and in my activity,if finds thescreenis
> > locked,it have to
> > hide thescreen,in order to display itself.
>
> Why not use a Notification? That's the preferred means of alerting the
> user to something that has occurred in the background.

Sorry,I have tried to use Notification,but it is not right way.
When my activity is displaying,user can click the button on the
activity,
so the user can interrupt the operation the computer is doing now.
but Notification can not let user to do this,it still have to unlock
the screen,
then user could do things what the activity can let the user do.

> > If the the messages is keeping on sending to my service,
> > when user keeping on operating the computer,my activity will be called
> > again and again,
> > so it have to hide and rediplay thelockagain and again.
>
> What you are describing sounds like an incredible drain on the battery,
> coupled with a UI that will interfere with any other use of the device
> (Want to send an SMS? Tough! Your activity will keep forcing itself to
> the foreground!). I sure hope you know what your users will want...

A little differrence,I want to display what the  computer is doing
now,and also
give a chance for user to interrupt the opration in my activity.When a
new operation is coming,
the old activity will be finished, a new activity is showing.

> > Maybe someone could tell me how to remove thelockwhen my activity is
> > loaded,and to add thelockwhen my activity finished,
> > this will give me a new way to deal my problem.
>
> onCreate() and onDestroy(), perhaps?

I mean to remove the function of the lock for a moment(not to use
KeyguardManager to hide lock and redisplay),
when user finishs his operation,I revert the function.
--~--~---------~--~----~------------~-------~--~----~
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