Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Toast not showing on HTC Sense 3.0 lock screen

Tags:

android

sense

I have created a program that displays a toast every time I receive an incoming call. It is working fine on all phones I've tried - toast showing on the incoming call screen.

Yesterday I updated my HTC Desire S to Sense 3.0 (Android 2.3.5) and apparently it has a new lock screen that displays incoming calls. Opening the lock screen will bring me to the "original" incoming call screen and answer the call. I can also see my toast on the original call screen just for a second, before the call is answered.

The toast I display uses a custom layout, and it is displayed from a service. The service receives an intent from a broadcast receiver on incoming call.

I use the following code to show my toast:

LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.popup_toast,  null);

toast = new Toast(getApplicationContext());
toast.setGravity(Gravity.TOP | Gravity.FILL_HORIZONTAL, 0, 0);
toast.setDuration(Toast.LENGTH_SHORT);
toast.setView(layout);
toast.show();

Is there any way to set so that the toast is shown over the new Sense 3.0 lock screen?

like image 755
Franz Avatar asked Nov 30 '11 10:11

Franz


1 Answers

I think the problem is a little wider. In my case, HTC sense 3.0 lock screen doesn't allow displaying activity dialog (as same as Toast message). When screen is unlocked dialog (activity fired from background service) is displayed just fine. The only way to display a message on HTC sense screen lock is to use notification - and many would agree that this is a recomended approach (like don't bother user with popups). Drawback is in notification nature - it will disapear after second or two. So for "caller ID" kind of applications user should quickly pull HTC from pocket if wants to see who is calling and that's not appropriate for sure.

Maybe OpenSense SDK contains API to enable displaying message on screen lock for a longer period. On my first look I only found "sense styled" tabs ...

Someone suggested to unlock phone "programmatically" and then display a Toast or Dialog. This is not a "happy" solution - and not even sure if is possible.

I know my post isn't a complete answer, but I hope it gives more details about problem of showing messages on HTC sense 3.0 lock screen.

like image 166
dbunic Avatar answered Nov 05 '22 02:11

dbunic