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
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.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With