public Context getContext() { Context current = context; if (context == null) { context = Platform.getCurrentActivity(); } if (context == null) { Exception e = new Exception("Context is not set"); e.printStackTrace(); } return context; }