Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to format text string sent via Share menu
    primarykey
    data
    text
    <p>I use the following code to get TEXT sent to my app from other apps via Share menu, and display the TEXT in an EditText. </p> <pre><code>Intent receivedIntent = getIntent(); String receivedAction = receivedIntent.getAction(); String receivedType = receivedIntent.getType(); TextView txtView = (EditText) findViewById(R.id.edWord); //if(receivedAction.equals(Intent.ACTION_SEND)){ if (Intent.ACTION_SEND.equals(receivedAction) &amp;&amp; receivedType != null) { if(receivedType.startsWith("text/")) { String receivedText = receivedIntent.getStringExtra(Intent.EXTRA_TEXT).toLowerCase(); if (receivedText != null) { txtView.setText(receivedText); txtView.requestFocus(); ListView myList=(ListView) findViewById(R.id.lstWord); myList.setFocusableInTouchMode(true); myList.setSelection(0); } else txtView.setText(""); } } </code></pre> <p>Everything works well, i.e., the sent text is displayed in my EditText (namely <code>edWord</code> in the above code). But the problem is the text sent via Share sometimes consists of meaningless elements or derivatives, e.g.: <code>"word</code>, <code>word'</code>, <code>word,</code> or <code>looked</code>, <code>books</code>, <code>tomatoes</code>. </p> <p>Now what I want is to format the text so that it contains only real word or the base form of the word before it is added to EditText. </p> <p>I've heard about <code>approximate string matching</code> or <code>fuzzy searching</code> but I have no idea how to apply it to my code. I wonder whether you can give me a little help to solve the above problem, at least with formatting/stripping non-word elements.</p> <p>Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload