File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
app/src/main/java/com/osfans/trime/ime/keyboard Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -208,19 +208,20 @@ class CommonKeyboardActionListener(
208208 }
209209 " commit" -> service.commitText(arg)
210210 " date" -> service.commitText(customFormatDateTime(arg))
211- " run" ->
212- service.startActivity(
213- buildIntentFromArgument(arg)?.apply {
214- flags = Intent .FLAG_ACTIVITY_NEW_TASK or Intent .FLAG_ACTIVITY_NO_HISTORY
215- },
216- )
211+ " run" -> {
212+ val intent = buildIntentFromArgument(arg)
213+ if (intent != null ) {
214+ intent.flags = Intent .FLAG_ACTIVITY_NEW_TASK or Intent .FLAG_ACTIVITY_NO_HISTORY
215+ service.startActivity(intent)
216+ }
217+ }
217218 " share_text" -> service.shareText()
218219 else -> {
219- service.startActivity(
220- buildIntentFromAction(action.command, arg)?. apply {
221- flags = Intent .FLAG_ACTIVITY_NEW_TASK or Intent .FLAG_ACTIVITY_NO_HISTORY
222- },
223- )
220+ val intent = buildIntentFromAction(action.command, arg)
221+ if (intent != null ) {
222+ intent. flags = Intent .FLAG_ACTIVITY_NEW_TASK or Intent .FLAG_ACTIVITY_NO_HISTORY
223+ service.startActivity(intent)
224+ }
224225 }
225226 }
226227 }
You can’t perform that action at this time.
0 commit comments