diff --git a/app/bind.sh b/app/bind.sh index ad65e2f..31b1ff9 100755 --- a/app/bind.sh +++ b/app/bind.sh @@ -2,7 +2,7 @@ export PROJECTPATH=$PWD export GOPATH="$PROJECTPATH/go" -export GO111MODULE=auto +export GO111MODULE=on if [ -z "$1" ]; then echo "Usage: ./bind.sh " @@ -38,6 +38,7 @@ if [[ ! "$1" == *\/* ]]; then LIBPATH="." fi go get golang.org/x/mobile/bind +gomobile init gomobile bind -target android -androidapi 21 -javapkg space.rocketnine -o $PROJECTPATH/libs/gmitohtml.aar $LIBPATH echo "Finished." diff --git a/app/src/main/java/space/rocketnine/xenia/XeniaService.java b/app/src/main/java/space/rocketnine/xenia/XeniaService.java index b1a1201..f03d75e 100644 --- a/app/src/main/java/space/rocketnine/xenia/XeniaService.java +++ b/app/src/main/java/space/rocketnine/xenia/XeniaService.java @@ -78,7 +78,11 @@ public class XeniaService extends Service { Intent notificationIntent = new Intent(this, MainActivity.class); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); - PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); + int flags = 0; + if (Build.VERSION.SDK_INT >= 23) { + flags = PendingIntent.FLAG_MUTABLE; + } + PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, flags); builder.setContentIntent(pendingIntent);