【发布时间】:2022-01-20 01:22:11
【问题描述】:
我正在尝试调用具有某些参数的 android 应用程序,有人可以通过尝试将以下代码转换为颤振来帮助我吗,我正在使用 Android Intent 颤振包但运气不佳。
下面是我试图从 Native android / Groovy 转换为 Flutter 的代码
val launchIntent = Intent()
launchIntent.action = "CenDroid"
launchIntent.putExtra("Operation", "Sale")
// Get the time
val millisecond: Long = java.lang.System.currentTimeMillis()
val timeString = milliseconds.toString()
launchIntent.putExtra("Time", timeString)
launchIntent.putExtra("Caller", "Caller Name")
// InvocationKey is Sha512 of Sha256 of Sha1 of whatever is sent in the Time field.
var hashed = HashUtils.sha1(timeString)
hashed = HashUtils.sha256(hashed)
hashed = HashUtils.sha512(hashed)
launchIntent.putExtra("InvocationKey", hashed)
launchIntent.putExtra("Amount", 100.0F)
launchIntent.flags = Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
startActivityForResult(launchIntent, 1)
任何帮助都会有很大帮助
【问题讨论】: