remove View In Top - Android User Interface

Android examples for User Interface:View Layer

Description

remove View In Top

Demo Code


//package com.java2s;

import android.content.Context;

import android.view.View;
import android.view.WindowManager;

public class Main {
    public static final String WINDOW_SERVICE = "window";

    public static void removeViewInTop(Context context, View view) {
        WindowManager wm = (WindowManager) context.getApplicationContext()
                .getSystemService(WINDOW_SERVICE);
        try {//from w ww .  ja  v  a 2s  .com
            wm.removeView(view);
        } catch (Exception e) {
        }
    }
}

Related Tutorials