how to call activity from inputmethodservice and pass data to Inputmethodsevice from activity
<p>I have a soft keyboard as a inputmethodservice calling an activity. A button is pressed and a scanner is activated. The scanner activity captures a set of data then returns the data to the inputmethodservice for filling in a text field on a browser.</p>

<p>How do I return the scan value of the activity back to the inputmethodservice and how to set to getCurrentInputConnection().commitText(data, 1)?
the following snnipet for call scannerActivity</p>

<pre><code>final Intent intent = new Intent(Intent.ACTION_MAIN, null);
                final ComponentName cn = new ComponentName(
                        "com.example.android.softkeyboard",
                        "com.example.android.softkeyboard.ScannerActivity");
                intent.setComponent(cn);
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivity(intent);
</code></pre>
