• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Incoming Call Screen obstruction by an Activity (Theme Dialog) over it.

 
Ranch Hand
Posts: 162
1
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello geeks

I am trying to show an Activity (with Theme Dialog) over an Incoming call Screen to show some information. I am done with the that, but the problem is whenever the call comes, Activity Dialog pops up over it and it covers SLIDER ( for accepting/Rejecting calls) .

I want the Activity Dialog over Incoming call screen but still wants the user to pick/reject calls.

Warm Regards
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You will have to add controls to your activity to handle the accept / reject calls.
 
Sangel Kapoor
Ranch Hand
Posts: 162
1
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Steve It seems like this is not the case as the following and many other apps are doing the same

Try this : [Current Caller ID] https://play.google.com/store/apps/details?id=com.webascender.callerid&hl=ms

 
Sangel Kapoor
Ranch Hand
Posts: 162
1
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Steve

Moreover iff you see Toast behavior , it does not obstruct the behavior of incoming call screen.

 
Steve Luke
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sahil Rally wrote:@Steve

Moreover iff you see Toast behavior , it does not obstruct the behavior of incoming call screen.



Toasts are a special UI mechanism, it is hard to equate your UI to them. But it did get me thinking.

Toasts are sort of like timed modal dialogs. They actually do prevent interacting with the UI for a brief period of time (at least on my phones.) I know Android has Modal Dialog support (see http://developer.android.com/guide/topics/ui/dialogs.html). But do they have non-modal dialog support?

Turns out they do. There is a flag in the Windows Manager that can help: FLAG_NOT_TOUCH_MODAL. So you would use a Dialog to display your stuff, and when you make the dialog use myDialog.getWindow().setFlags() with the FLAG_NOT_TOUCH_MODAL flag.

See if that helps you out. I think when dialogs appear they actually dim the background making it hard to see what is around them (to keep your focus). I am sure this is also a Flag, probably in the same WindowManager.LayoutParams class.
 
Sangel Kapoor
Ranch Hand
Posts: 162
1
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Steve

I am already using this flag. This flag is used in order to send the user touch events to the windows behind it. But the problem is i cannot see the slider behind it, only slider is invisible, the other part ie the Incoming phone number is visible.


 
Steve Luke
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been playing around with it a bit, and had the same thing happen a few times - off and on, so I figured it was a timing issue. I added a Thread.sleep(1000) in the phone state listener before showing the Activity I overlayed on the screen and that seemed to make the thing behave smoother. This is in the emulator so a real phone may need less time (I didn't really try any value but 1000).

One thing I noticed is the Animation on the incoming call screen does not continue, but the control is there and functional.

The activity
 
Steve Luke
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
p.s. You probably shouldn't use Thread.sleep(), rather use a scheduler (like the Handler) to postpone the startActivity() call.
 
Sangel Kapoor
Ranch Hand
Posts: 162
1
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried , issue is not of timings, issue is not being able to touch the Slider behind since it disappears when my avtivity is launched over it. The problem still persists ....

I used the following in my Activity


and my manifest dictates





 
Steve Luke
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sahil Rally wrote:I tried , issue is not of timings, issue is not being able to touch the Slider behind since it disappears when my avtivity is launched over it. The problem still persists ....


Did you try the delay? As I said, in my code above I saw the same behavior. After analyzing it looks like the phone activity gets built in 3 parts. The background, the top portion where the person's picture/incoming info appears, and the bottom part where the answer/reject control sits. It seems (in my demo code) when the dialog appeared before one of the parts, that part would not show up, and it would be most likely to appear before the answer/reject section was visible.

The delay pushed the dialog to not show until after all components were made.

So, 2 things to try:
1) Add the delay before showing your activity
2) Try my code and see if you get different behavior

 
Sangel Kapoor
Ranch Hand
Posts: 162
1
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was already doing the delay, since the Dialog activity goes behind the incoming call screen.

Here is the code.... Seems like if my Dialog activity launches after the "Second Part" and before the "Third part (ie Answer dialer) , then everything woks fine.


Here is my code..... dont know where the problem is..... and the fact is other applications are successfully doing this.....


 
Sangel Kapoor
Ranch Hand
Posts: 162
1
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic