Question: I'm using GcmNetworkManager to schedule a OneoffTask with an execution windows starting from 0. In the [documentations](https://developers.google.com/android/reference/com/google/android/gms/gcm/OneoffTask) it mentions 

> 
> Note that you can request a one-off task to be executed at any point in the future, but to prevent abuse the scheduler will only set an alarm at a minimum of 30 seconds in the future. Your task can still be run earlier than this if some network event occurs to wake up the scheduler.
> 
> 
> 

This this is problematic for me since I have to wait 30 seconds for a task to be executed whereas I want it to be executed immediately if possible. Is there any way to achieve this?

Answer: 
ListPopupWindow has a couple calls from API 11 onward.

```
void setPromptView(View prompt)
void setPromptPosition(int position)

```

These will add a custom view above or below the list view but not both at the same time. The view will not be affected by the list view scrolling.
> 
> add a header in popup window which should be fixed over popup list
> 
> 
> 

You can achive same by adding Header for ListView which is inside PopUpWindow. do it as:

```
TextView tv = new TextView(this);
tv.setText("your title text here");
listView.addHeaderView(tv);

```

Or you can also use custom layout for HeaderView see following tutorial :

[Listview with header footer view android](https://blograchita.wordpress.com/2013/05/18/listview-with-header-footer-view-android/)