69 {
70 if (activityBinding == null) {
71 result.error(
"error",
"Plugin not bound to an Activity",
null);
72 return;
73 }
74
75 if (
Build.VERSION.SDK_INT < API_LEVELS.API_23) {
76 result.error(
"error",
"Android version not supported",
null);
77 return;
78 }
79
80 if (resolveInfosById == null) {
81 result.error(
"error",
"Can not process text actions before calling queryTextActions",
null);
82 return;
83 }
84
85 final ResolveInfo
info = resolveInfosById.get(
id);
87 result.error(
"error",
"Text processing activity not found",
null);
88 return;
89 }
90
91 Integer requestCode =
result.hashCode();
92 requestsByCode.put(requestCode,
result);
93
94 Intent intent = new Intent();
95 intent.setClassName(
info.activityInfo.packageName,
info.activityInfo.name);
96 intent.setAction(Intent.ACTION_PROCESS_TEXT);
97 intent.setType("text/plain");
98 intent.putExtra(Intent.EXTRA_PROCESS_TEXT, text);
99 intent.putExtra(Intent.EXTRA_PROCESS_TEXT_READONLY, readOnly);
100
101
102
103
104 activityBinding.getActivity().startActivityForResult(intent, requestCode);
105 }
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Build(configs, env, options)