Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 7b2a2281 authored by 62160052's avatar 62160052
Browse files

Android Permissions

parent 35c7f847
Branches
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.marsphotos"> package="com.example.android.marsphotos">
<uses-permission android:name="android.permission.INTERNET" />
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
......
...@@ -46,8 +46,12 @@ class OverviewViewModel : ViewModel() { ...@@ -46,8 +46,12 @@ class OverviewViewModel : ViewModel() {
*/ */
private fun getMarsPhotos() { private fun getMarsPhotos() {
viewModelScope.launch { viewModelScope.launch {
try {
val listResult = MarsApi.retrofitService.getPhotos() val listResult = MarsApi.retrofitService.getPhotos()
_status.value = listResult _status.value = listResult
} catch (e: Exception) {
_status.value = "Failure: ${e.message}"
}
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment