Buggy code:
public class OpenHABWidgetListFragment extends ListFragment { private static final String TAG = "OpenHABWidgetListFragment" ; private OnWidgetSelectedListener widgetSelectedListener ; private OpenHABWidgetDataSource openHABWidgetDataSource ; private OpenHABWidgetAdapter openHABWidgetAdapter ; private String displayPageUrl ; private String sitemapRootUrl = "" ; private String openHABBaseUrl = "https:////demo.openhab.org:8443//" ; private ArrayList < OpenHABWidget > widgetList = new ArrayList < OpenHABWidget > ( ) ; private String openHABUsername = "" ; private String openHABPassword = "" ; private OpenHABWidget selectedOpenHABWidget ; private String nfcWidgetId ; private String nfcCommand ; private boolean nfcAutoClose = false ; private OpenHABMainActivity mActivity ; private MyAsyncHttpClient mAsyncHttpClient ; private boolean mIsVisible = false ; private OpenHABWidgetListFragment mTag ; private int mCurrentSelectedItem = - 1 ; private int mPosition ; private int mOldSelectedItem = - 1 ; private String mAtmosphereTrackingId ; private Handler networkHandler = new Handler ( ) ; private Runnable networkRunnable ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { } @ Override public void onPause ( ) { } @ Override public void onResume ( ) { } @ Override public void onSaveInstanceState ( Bundle savedInstanceState ) { } @ Override public void setUserVisibleHint ( boolean isVisibleToUser ) { } public static OpenHABWidgetListFragment withPage ( String pageUrl , String baseUrl , String rootUrl , String username , String password , int position ) { } public void showPage ( String pageUrl , final boolean longPolling ) { } public void processContent ( Document document , boolean longPolling ) { openHABWidgetAdapter . stopVideoWidgets ( ) ; openHABWidgetAdapter . stopImageRefresh ( ) ; Node rootNode = document . getFirstChild ( ) ; openHABWidgetDataSource . setSourceNode ( rootNode ) ; widgetList . clear ( ) ; for ( OpenHABWidget w : openHABWidgetDataSource . getWidgets ( ) ) { if ( ( w . getType ( ) . equals ( "Frame" ) ) && ( TextUtils . isEmpty ( w . getLabel ( ) ) ) ) continue ; widgetList . add ( w ) ; } openHABWidgetAdapter . notifyDataSetChanged ( ) ; <START_BUG> if ( ! longPolling ) { <END_BUG> getListView ( ) . clearChoices ( ) ; Log . d ( OpenHABWidgetListFragment . TAG , String . format ( "processContent<seq2seq4repair_space>selectedItem<seq2seq4repair_space>=<seq2seq4repair_space>%d" , mCurrentSelectedItem ) ) ; if ( ( mCurrentSelectedItem ) >= 0 ) getListView ( ) . setItemChecked ( mCurrentSelectedItem , true ) ; } if ( ( ( getActivity ( ) ) != null ) && ( mIsVisible ) ) getActivity ( ) . setTitle ( openHABWidgetDataSource . getTitle ( ) ) ; if ( ( ( this . nfcWidgetId ) != null ) && ( ( this . nfcCommand ) != null ) ) { Log . d ( OpenHABWidgetListFragment . TAG , "Have<seq2seq4repair_space>widget<seq2seq4repair_space>and<seq2seq4repair_space>command,<seq2seq4repair_space>NFC<seq2seq4repair_space>action!" ) ; OpenHABWidget nfcWidget = this . openHABWidgetDataSource . getWidgetById ( this . nfcWidgetId ) ; OpenHABItem nfcItem = nfcWidget . getItem ( ) ; if ( ( nfcWidget != null ) && ( nfcItem != null ) ) { if ( this . nfcCommand . equals ( "TOGGLE" ) ) { if ( nfcItem . getType ( ) . equals ( "RollershutterItem" ) ) { if ( nfcItem . getStateAsBoolean ( ) ) this . openHABWidgetAdapter . sendItemCommand ( nfcItem , "UP" ) ; else this . openHABWidgetAdapter . sendItemCommand ( nfcItem , "DOWN" ) ; } else { if ( nfcItem . getStateAsBoolean ( ) ) this . openHABWidgetAdapter . sendItemCommand ( nfcItem , "OFF" ) ; else this . openHABWidgetAdapter . sendItemCommand ( nfcItem , "ON" ) ; } } else { this . openHABWidgetAdapter . sendItemCommand ( nfcItem , this . nfcCommand ) ; } } this . nfcWidgetId = null ; this . nfcCommand = null ; if ( this . nfcAutoClose ) { getActivity ( ) . finish ( ) ; } } showPage ( displayPageUrl , true ) ; } private void stopProgressIndicator ( ) { } private void startProgressIndicator ( ) { } private void showAlertDialog ( String alertMessage ) { } public void setOpenHABUsername ( String openHABUsername ) { } public void setOpenHABPassword ( String openHABPassword ) { } public void setDisplayPageUrl ( String displayPageUrl ) { } public String getDisplayPageUrl ( ) { } public String getTitle ( ) { } public void clearSelection ( ) { } public int getPosition ( ) { } }

Fix:
if ( ( ! longPolling ) && ( isAdded ( ) ) ) {