diff --git a/ChangeLogLibrary/src/main/java/it/gmariotti/changelibs/library/view/ChangeLogListView.java b/ChangeLogLibrary/src/main/java/it/gmariotti/changelibs/library/view/ChangeLogListView.java index 457b449..94a1be9 100644 --- a/ChangeLogLibrary/src/main/java/it/gmariotti/changelibs/library/view/ChangeLogListView.java +++ b/ChangeLogLibrary/src/main/java/it/gmariotti/changelibs/library/view/ChangeLogListView.java @@ -24,9 +24,11 @@ import android.view.View; import android.widget.AdapterView; import android.widget.ListView; +import android.widget.Toast; import it.gmariotti.changelibs.R; import it.gmariotti.changelibs.library.Constants; +import it.gmariotti.changelibs.library.Util; import it.gmariotti.changelibs.library.internal.ChangeLog; import it.gmariotti.changelibs.library.internal.ChangeLogAdapter; import it.gmariotti.changelibs.library.internal.ChangeLogRow; @@ -141,7 +143,10 @@ protected void initAdapter() { mAdapter.setmRowHeaderLayoutId(mRowHeaderLayoutId); //Parse in a separate Thread to avoid UI block with large files - new ParseAsyncTask(mAdapter,parse).execute(); + if (mChangeLogFileResourceUrl==null || (mChangeLogFileResourceUrl!=null && Util.isConnected(getContext()))) + new ParseAsyncTask(mAdapter,parse).execute(); + else + Toast.makeText(getContext(),R.string.changelog_internal_error_internet_connection,Toast.LENGTH_LONG).show(); setAdapter(mAdapter); }else{ setAdapter(null); diff --git a/ChangeLogLibrary/src/main/res/values/strings.xml b/ChangeLogLibrary/src/main/res/values/strings.xml index bf7c5a1..03025b0 100644 --- a/ChangeLogLibrary/src/main/res/values/strings.xml +++ b/ChangeLogLibrary/src/main/res/values/strings.xml @@ -3,6 +3,7 @@ Error while parsing file + No internet connection to fetch the changelog