added MediaActivity to Manifest. removed runOnUiThread

Signed-off-by: nuclearfog <hatespirit666@gmail.com>
This commit is contained in:
nuclearfog 2021-11-14 21:46:37 +01:00
parent 1711058aca
commit ac13b1a1b8
No known key found for this signature in database
GPG Key ID: AA0271FBE406DB98
2 changed files with 8 additions and 18 deletions

View File

@ -92,6 +92,11 @@
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<activity
android:name=".activity.MediaActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
<activity
android:name=".activity.DirectMessage"
android:screenOrientation="portrait"

View File

@ -135,30 +135,15 @@ public abstract class MediaActivity extends AppCompatActivity implements Locatio
if (permissions.length > 0 && grantResults.length > 0) {
// read storage permission granted
if (PERMISSIONS[0][0].equals(permissions[0]) && grantResults[0] == PERMISSION_GRANTED) {
runOnUiThread(new Runnable() {
@Override
public void run() {
openMediaPicker(requestCode);
}
});
openMediaPicker(requestCode);
}
// location permission granted
else if (PERMISSIONS[1][0].equals(permissions[0])) {
runOnUiThread(new Runnable() {
@Override
public void run() {
getLocation(false);
}
});
getLocation(false);
}
// Write storage permissions granted
else if (PERMISSIONS[2][0].equals(permissions[0]) && grantResults[0] == PERMISSION_GRANTED) {
runOnUiThread(new Runnable() {
@Override
public void run() {
saveImage();
}
});
saveImage();
}
}
}