Skip to content
Snippets Groups Projects
Commit 55f85e16 authored by Dennis Kupczyk's avatar Dennis Kupczyk
Browse files

fixed ANdroid 12 issue

parent 847f85e0
No related branches found
No related tags found
No related merge requests found
Pipeline #13792 failed
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\GoldenSnakeBite\.android\avd\Pixel_5_API_30.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2022-05-02T22:04:57.751283500Z" />
</component>
</project>
\ No newline at end of file
......@@ -17,8 +17,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config">
android:theme="@style/AppTheme">
<!--- networkSecurityConfig dient dem Testzweck ToDo:löschen -->
<!-- Declare foreground service -->
......
......@@ -22,8 +22,19 @@ public class ForeGroundService extends Service {
Intent notificationIntent = new Intent(this, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this,
0, notificationIntent, 0);
PendingIntent pendingIntent = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
pendingIntent = PendingIntent.getActivity
(this, 0, notificationIntent, PendingIntent.FLAG_MUTABLE);
}
else
{
pendingIntent = PendingIntent.getActivity
(this, 0, notificationIntent, PendingIntent.FLAG_ONE_SHOT);
}
//PendingIntent pendingIntent = PendingIntent.getActivity(this,
// 0, notificationIntent, 0);
Notification notification = new NotificationCompat.Builder(this, "CHANNEL1ID1")
.setContentTitle("ADENiA Sensor App")
......
......@@ -4,5 +4,5 @@
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Mon May 02 23:45:32 CEST 2022
sdk.dir=C\:\\Users\\GoldenSnakeBite\\AppData\\Local\\Android\\Sdk
#Thu May 05 18:34:39 CEST 2022
sdk.dir=C\:\\Users\\GSB- Surface\\AppData\\Local\\Android\\Sdk
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment