Add more helpful message when an error occurs in channels list

This commit is contained in:
Synced Synapse 2015-11-10 23:18:33 +00:00
parent 5823a50c1d
commit e6f6d74784
3 changed files with 8 additions and 2 deletions

View File

@ -35,6 +35,7 @@ import android.widget.Toast;
import org.xbmc.kore.R;
import org.xbmc.kore.host.HostManager;
import org.xbmc.kore.jsonrpc.ApiCallback;
import org.xbmc.kore.jsonrpc.ApiException;
import org.xbmc.kore.jsonrpc.method.PVR;
import org.xbmc.kore.jsonrpc.method.Player;
import org.xbmc.kore.jsonrpc.type.PVRType;
@ -205,8 +206,11 @@ public class PVRListFragment extends Fragment
if (!isAdded()) return;
LogUtils.LOGD(TAG, "Error getting channel groups: " + description);
// To prevent the empty text from appearing on the first load, set it now
emptyView.setText(String.format(getString(R.string.error_getting_pvr_info), description));
if (errorCode == ApiException.API_ERROR) {
emptyView.setText(String.format(getString(R.string.might_not_have_pvr), description));
} else {
emptyView.setText(String.format(getString(R.string.error_getting_pvr_info), description));
}
Toast.makeText(getActivity(),
String.format(getString(R.string.error_getting_pvr_info), description),
Toast.LENGTH_SHORT).show();

View File

@ -23,5 +23,6 @@
android:layout_gravity="center"
android:gravity="center"
android:visibility="gone"
android:padding="@dimen/default_padding"
android:text="@string/loading"/>

View File

@ -339,6 +339,7 @@
<string name="play_on_kodi">Play on Kodi</string>
<string name="error_getting_pvr_info">An error occurred while getting channels info: %1$s</string>
<string name="might_not_have_pvr">An error occurred while getting channels info, probably because your media center doesn\'t have a tuner or it isn\'t configured.\n\nIf that\'s the case and you\'d like to remove this entry from the side menu, you can do it in the Settings.</string>
<string name="error_starting_channel">An error occurred starting channel playback: %1$s</string>
<string name="channel_switching">Switching to channel %1$s</string>