|
6 | 6 | import android.content.SharedPreferences; |
7 | 7 | import android.content.pm.PackageManager; |
8 | 8 | import android.os.Bundle; |
9 | | -import android.support.annotation.NonNull; |
10 | 9 | import android.util.Log; |
11 | | -import android.view.View; |
12 | 10 | import android.widget.Button; |
13 | 11 | import android.widget.Toast; |
14 | 12 |
|
| 13 | +import androidx.annotation.NonNull; |
| 14 | + |
15 | 15 | import java.net.URL; |
16 | 16 | import java.util.Date; |
17 | 17 |
|
18 | 18 | import ch.freshbits.pathshare.sdk.Pathshare; |
19 | 19 | import ch.freshbits.pathshare.sdk.helper.InvitationResponseListener; |
20 | 20 | import ch.freshbits.pathshare.sdk.helper.PermissionRequester; |
21 | 21 | import ch.freshbits.pathshare.sdk.helper.ResponseListener; |
22 | | -import ch.freshbits.pathshare.sdk.helper.SessionExpirationListener; |
23 | 22 | import ch.freshbits.pathshare.sdk.helper.SessionResponseListener; |
24 | 23 | import ch.freshbits.pathshare.sdk.model.Destination; |
25 | 24 | import ch.freshbits.pathshare.sdk.model.Session; |
@@ -174,13 +173,11 @@ private boolean hasLocationPermission() { |
174 | 173 |
|
175 | 174 | @Override |
176 | 175 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { |
177 | | - switch (requestCode) { |
178 | | - case TAG_PERMISSIONS_REQUEST_LOCATION_ACCESS: { |
179 | | - if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { |
180 | | - performJoinSession(); |
181 | | - } else { |
182 | | - Toast.makeText(this, R.string.permission_access_fine_location_denied, Toast.LENGTH_SHORT).show(); |
183 | | - } |
| 176 | + if (requestCode == TAG_PERMISSIONS_REQUEST_LOCATION_ACCESS) { |
| 177 | + if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { |
| 178 | + performJoinSession(); |
| 179 | + } else { |
| 180 | + Toast.makeText(this, R.string.permission_access_fine_location_denied, Toast.LENGTH_SHORT).show(); |
184 | 181 | } |
185 | 182 | } |
186 | 183 | } |
|
0 commit comments