1

Based on my requirement I need to show pop over call screen. I used broadcast receiver for getting call state. I'm successfully getting call state and I show pop up on native call screen.

I follow this procedure: In receiver on phone state I call a service for showing pop up by using window manager. It works fine.

After call is disconnected I call stop service. Inside I wrote windowmanager.removeView() but my view is not removed from my screen.

So how to remove view from window manager? If you have any other way for this, please share it.

Mario Kutlev
  • 4,897
  • 7
  • 44
  • 62
kiran
  • 3,244
  • 7
  • 34
  • 57

1 Answers1

3

You need to pass the id of the view to be destroyed:

View myView = findViewById(R.id.viewtodestroy);
windowmanager.removeView(myView);

where viewtodestroy is the view to destroy.

Claudio
  • 642
  • 3
  • 12