make New Window - Android User Interface

Android examples for User Interface:Window

Description

make New Window

Demo Code

import java.lang.reflect.Method;

import android.content.Context;
import android.view.Window;

public class Main {
  private static final String TAG = "";

  public static Window makeNewWindow(Context context) {
    Window w = null;//from w w  w.j a  v a2s  . c  om
    try {
      Class<?> clazz;
      clazz = Class.forName("com.android.internal.policy.PolicyManager");
      Method method = clazz.getMethod("makeNewWindow", Context.class);
      w = (Window) method.invoke(clazz, context);
    } catch (Exception e) {

    }

    return w;
  }
}

Related Tutorials