summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorTanuj <thetanuj@hotmail.com>2022-09-15 19:05:55 +0530
committerTanuj <thetanuj@hotmail.com>2022-09-15 19:05:55 +0530
commit35495a3941e7ec4cff9ddde7af53db855e8fd246 (patch)
tree3e871fed2a599c052e646b310f4199e246eb49a5 /app/src/main/java
parent7ddca3ec7ac0a55d1b56768bc90750164d439cc8 (diff)
downloadSidePhOnelauncher-35495a3941e7ec4cff9ddde7af53db855e8fd246.tar.gz
SidePhOnelauncher-35495a3941e7ec4cff9ddde7af53db855e8fd246.tar.bz2
SidePhOnelauncher-35495a3941e7ec4cff9ddde7af53db855e8fd246.zip
Changes in open calendar
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/app/olauncher/helper/Utils.kt13
1 files changed, 6 insertions, 7 deletions
diff --git a/app/src/main/java/app/olauncher/helper/Utils.kt b/app/src/main/java/app/olauncher/helper/Utils.kt
index c5ca47e..60b4cb7 100644
--- a/app/src/main/java/app/olauncher/helper/Utils.kt
+++ b/app/src/main/java/app/olauncher/helper/Utils.kt
@@ -40,6 +40,7 @@ import java.util.*
import kotlin.math.pow
import kotlin.math.sqrt
+
fun showToastLong(context: Context, message: String) =
Toast.makeText(context.applicationContext, message, Toast.LENGTH_LONG).show()
@@ -401,13 +402,11 @@ fun openAlarmApp(context: Context) {
fun openCalendar(context: Context) {
try {
- val cal: Calendar = Calendar.getInstance()
- cal.time = Date()
- val time = cal.time.time
- val builder: Uri.Builder = CalendarContract.CONTENT_URI.buildUpon()
- builder.appendPath("time")
- builder.appendPath(time.toString())
- context.startActivity(Intent(Intent.ACTION_VIEW, builder.build()))
+ val calendarUri = CalendarContract.CONTENT_URI
+ .buildUpon()
+ .appendPath("time")
+ .build()
+ context.startActivity(Intent(Intent.ACTION_VIEW, calendarUri))
} catch (e: Exception) {
try {
val intent = Intent(Intent.ACTION_MAIN)