mirror of
https://github.com/libretro/RetroArch
synced 2025-02-05 15:40:04 +00:00
Android: Handle case where core list could not be retrieved better
This commit is contained in:
parent
8b14bbc6e2
commit
9e3587c96f
@ -44,6 +44,7 @@
|
||||
<string name="download_core_confirm_title">Confirm</string>
|
||||
<string name="download_core_confirm_msg">Are you sure you want to download %1$s?</string>
|
||||
<string name="downloading_msg">Downloading %1$s…</string>
|
||||
<string name="download_core_list_error">Error retrieving list of cores.</string>
|
||||
|
||||
<!-- Core Downloader - Downloadable Cores Context Menu -->
|
||||
<string name="downloadable_cores_ctx_title">Actions</string>
|
||||
|
@ -41,6 +41,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.retroarch.R;
|
||||
|
||||
@ -193,9 +194,7 @@ public final class DownloadableCoresFragment extends ListFragment
|
||||
Log.e("PopulateCoresListOperation", e.getMessage());
|
||||
|
||||
// Make a dummy entry to notify an error.
|
||||
final ArrayList<DownloadableCore> errorList = new ArrayList<DownloadableCore>();
|
||||
errorList.add(new DownloadableCore("Error", e.getMessage()));
|
||||
return errorList;
|
||||
return new ArrayList<DownloadableCore>();
|
||||
}
|
||||
}
|
||||
|
||||
@ -203,7 +202,11 @@ public final class DownloadableCoresFragment extends ListFragment
|
||||
protected void onPostExecute(ArrayList<DownloadableCore> result)
|
||||
{
|
||||
super.onPostExecute(result);
|
||||
adapter.addAll(result);
|
||||
|
||||
if (result.isEmpty())
|
||||
Toast.makeText(adapter.getContext(), R.string.download_core_list_error, Toast.LENGTH_SHORT).show();
|
||||
else
|
||||
adapter.addAll(result);
|
||||
}
|
||||
|
||||
// Literally downloads the info file, writes it, and parses it for the corename key/value pair.
|
||||
|
Loading…
x
Reference in New Issue
Block a user