WindowManager.LayoutParams why is there a setTitle method?
Asked Answered
F

2

5

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

Fronia answered 17/3, 2013 at 17:21 Comment(0)
C
5

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.

Civil answered 17/3, 2013 at 18:6 Comment(4)
@Mr.Me Ah, but I didn't catch the SoftInputWindow and StatusBar Service :P nice going there.Civil
Both answers are actually some how "correct", accepting one is what i normally would do but both answers offer different information and therefor i would need to accept them both.... thinking...Banerjee
@RolfSmit Accept Mr. Me's. He actually managed to find two places where its used.Civil
@RolfSmit still Raghv Sood found an actual usage that I didn't mention (parcel writing) and debuggingNettlesome
N
4

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)

Nettlesome answered 17/3, 2013 at 18:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.