The Popup popup box was created in OnCreate when the exception
Unable to add window-token null was not valid; Is your activity running? Errors and how to modify them
Popup popup is to rely on a parent window or parent View, the root cause of this error is that the parent window has not been created when the call to the popup box caused the failure.
Instead, it can be resolved by invoking it in Onattachedtowindow.
Two
The difference between import static and import
Import static import is a new feature in JDK1.5. Generally we import a class with import com ..... ClassName, while static import is this: import static com ..... Classname.*, there is more static here, there is a class name ClassName behind more. *, which means to import static methods in this class. Of course, you can just import a static method, just change the. * to a static method name. Then in this class, you can call the static method directly with the method name, rather than using the ClassName. Method name.
The advantage of this approach is that it simplifies some operations, such as printing operations System.out.println (...); You can write it to a static method, print (...), and print (...) directly when you use it. You can do it.
But this method is recommended to use when there are a lot of repeated calls, if only one to two calls, it is better to write directly to the convenience
Android Development Notes (iii)