Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opposite of View.bringToFront() in Android

I was wondering if there is some opposite method of View.bringToFront()? When I call bringToFront() my whole screen get locked cause i have some problem with overriding the onMeasure() method(when I implement onMeasure, my custom View doesn't draw itself even it enters onDraw method) and my custom View takes up the whole screen ...

I badly need bringToFront() but I need to start some animation that lasts for three seconds and by calling bringToFront() user input doesn't work anymore.

Can I reset that bringToFront()?

like image 652
Milos Pesic Avatar asked Aug 21 '10 00:08

Milos Pesic


2 Answers

I was also looking for a sendToBack() method. However, this does not exist in the current API.

like image 104
DonnaLea Avatar answered Oct 22 '22 08:10

DonnaLea


call bringToFront() on the view you want to get in the front, and then call the invalidate() method on all the view including the view which you want in the front. Repeat same for all the listeners. So when another view's listener will get called, the previous view will get invalidated and will be in background.

like image 36
noob Avatar answered Oct 22 '22 07:10

noob