Pradeep
Pradeep

Reputation: 6613

How to determine if View is instance of PhoneWindow$DecorView

I have a method which receives list of Views, views could be instances of Linear Layout, Relative Layout, ImageView etc. I want to remove all Layout , PhoneDecor Views.

When I print the list of views, DecorView looks like as follows

com.android.internal.policy.impl.PhoneWindow$DecorView{f115dc3 V.E..... R.....I. 0,0-1440,2560

I am planning to have method like this

public List<View> filterViews(List<View> inputViews)
{
   //if view instanceOf LinearLayout or RelativeLayout  -- remove 
}

How can I check if view is instance of the type -- PhoneWindow$DecorView

Upvotes: 1

Views: 314

Answers (1)

Alexander
Alexander

Reputation: 48272

You could compare your class getName() with "com.android.internal.policy.impl.PhoneWindow.DecorView"

$ means DecorView is an inner class of the PhoneWindow class.

Upvotes: 2

Related Questions