如何使用可在应用程序的任何位置调用的文本框创建单个弹出布局。请参阅下面我的意思的伪代码;
PopUpClass popup;
private static Singleton instance = null;
class Singleton {
   if(instance == null) {
      instance = new Singleton ();
      // Instantiate a class pop up class layout
       popup = new PopUpClass(); // I dont know how to create this one
    }
    return instance;
}
SomeClass {
   private buttonClicked {
   Singleton singleton = new Singleton();
   PopUpClass popup = singleton.popup;
   //add the pop up class to current view
   }
}
这意味着我希望弹出类只创建一次,以便在某个类上完成的布局上的任何文本也可以在其他类上显示。