Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WindowManager.LayoutParams why is there a setTitle method?

So yesterday i was programming and suddenly i came across the setTitle method in the WindowManager.LayoutParams class, why would this class like this have a setTitle method? Where is is used for? The documentation does not say anything about the function.

My guess is that it could be used for debugging or something a like, but other than that i don't have a clue.

And why would it be declared as final method? Because it's not ready yet for us to override it?

Just wondering...

Note: Both answers below are some how "correct" and offer good information, but can only accept one.

getTitle

setTitle

like image 620
Rolf ツ Avatar asked Mar 17 '13 17:03

Rolf ツ


2 Answers

Going through the source code for WindowManager, it seems that the title isn't actually used anywhere, except in the debug and parcel writing methods.

Furthermore, searching google for +"windowmanager.layoutparams" +".setTitle()" site:grepcode.com doesn't seem to return any results where the setTitle() and getTitle() methods of WindowManager.LayoutParams are actually used in production code.

I'd say that the Android engineers felt that maybe at some point of time in the future they might need a title property, and put it in as a stub.

like image 161
Raghav Sood Avatar answered Sep 22 '22 11:09

Raghav Sood


Well There doen't seem to be any usage for this layout parameter value anywhere.

It seems like a place holder for now.

I only managed to find these tow cases where it has been used: SoftInputWindow and StatusBar Service

And visually both has no effect (at least on my device and emulator)

like image 36
Mr.Me Avatar answered Sep 21 '22 11:09

Mr.Me