Search code examples
androidlayoutparamsandroid-windowmanager

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


Solution

  • 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.