+
+ @SuppressWarnings("rawtypes")
+ @SuppressLint("PrivateApi")
+ private void traverseAndRemoveDecorCaption(View view) {
+ if(dcvRemoved || !(view instanceof ViewGroup))
+ return;
+
+ Class dcvClass;
+ try {
+ dcvClass = Class.forName("com.android.internal.widget.DecorCaptionView");
+ } catch (ClassNotFoundException e) {
+ return;
+ }
+
+ ViewGroup viewGroup = (ViewGroup) view;
+ int position = -1;
+
+ for(int i = 0; i < viewGroup.getChildCount(); i++) {
+ View child = viewGroup.getChildAt(i);
+
+ if(dcvClass.isInstance(child)) {
+ position = i;
+ break;
+ } else
+ traverseAndRemoveDecorCaption(child);
+ }
+
+ if(position >= 0) {
+ viewGroup.removeViewAt(position);
+ dcvRemoved = true;
+ }
+ }