Compare commits

...

4 Commits

Author SHA1 Message Date
akaessens 6c00e63d1f Update changelog 2021-04-27 18:13:36 +00:00
akaessens b37fa14d96 Prepare v0.4.4 2021-04-27 19:52:48 +02:00
akaessens c6e25fdcfb Update gradle build 2021-04-27 19:48:58 +02:00
akaessens 1ec5c5ea41 Fix Android 11 intent handling
related https://developer.android.com/about/versions/11/privacy/package-visibility

closes #32
2021-04-27 19:43:49 +02:00
5 changed files with 23 additions and 6 deletions

View File

@ -1,4 +1,6 @@
# Changelog
## v0.4.4 (14)
- Fix Android 11 intents (to open Calendar or Maps)
## v0.4.3 (13)
- Add spanish translation thanks to @sguinetti
- update dependencies

View File

@ -7,8 +7,8 @@ android {
applicationId "com.akdev.nofbeventscraper"
minSdkVersion 23
targetSdkVersion 30
versionCode 13
versionName "0.4.3"
versionCode 14
versionName "0.4.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@ -2,6 +2,7 @@ package com.akdev.nofbeventscraper;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@ -14,6 +15,7 @@ import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.recyclerview.widget.RecyclerView;
@ -116,8 +118,12 @@ public class EventAdapter extends
Uri intent_uri = Uri.parse(map_search);
Intent map_intent = new Intent(Intent.ACTION_VIEW, intent_uri);
if (map_intent.resolveActivity(view.getContext().getPackageManager()) != null) {
try {
view.getContext().startActivity(map_intent);
} catch (ActivityNotFoundException e) {
Toast toast=Toast.makeText(view.getContext(),"no App installed", Toast.LENGTH_SHORT);
toast.show();
}
}
};
@ -145,8 +151,11 @@ public class EventAdapter extends
String desc = event.url + "\n\n" + event.description;
intent.putExtra(CalendarContract.Events.DESCRIPTION, desc);
if (intent.resolveActivity(view.getContext().getPackageManager()) != null) {
try {
view.getContext().startActivity(intent);
} catch (ActivityNotFoundException e) {
Toast toast=Toast.makeText(view.getContext(),"no App installed", Toast.LENGTH_SHORT);
toast.show();
}
}
});
@ -213,7 +222,12 @@ public class EventAdapter extends
share_intent.setType("text/plain");
share_intent.putExtra(Intent.EXTRA_TEXT, event.url);
view.getContext().startActivity(Intent.createChooser(share_intent, null));
try {
view.getContext().startActivity(share_intent);
} catch (ActivityNotFoundException e) {
Toast toast=Toast.makeText(view.getContext(),"no App installed", Toast.LENGTH_SHORT);
toast.show();
}
}
});
}

View File

@ -8,7 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'com.android.tools.build:gradle:4.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

View File

@ -0,0 +1 @@
- Fix Android 11 intents (to open Calendar or Maps)