I have a custom activity group that adds and removes views in the stack.
Send
sending dispatch to special key press. The problem is that I need to check the current focused view like this:
view v = getCurrentFocus ();
When I check the type of view, it gives a type like this
com.android.internal.policy.impl. PhoneWindow $ DecorView
What is this type and do I cast the object of any type of this type?
Thanks
No, you can only see objects of any type Can not put! The best practice is that you should only put up the class hierarchy, or if you really want to put it down, make sure you check the first type using the example operator.
In addition to this, considering the name of the package it is an internal Android class, so you do not want any reference to that reference in your code - if it is internal, then it is non-API they You can also change the time and your app will be broken immediately.
Why are you looking at the type of view? Are you looking for a special type? If so, it would be safe to do (for example):
view v = getCurrentFocus ();
Or if you are interested in using getDecorView instead of GetCurrentFocus if it is the decor scene.
Comments
Post a Comment