Skip to content

Commit

Permalink
Handle ACTION_PROCESS_TEXT (closes #86)
Browse files Browse the repository at this point in the history
  • Loading branch information
itkach committed Jan 1, 2021
1 parent 148a37d commit 4c17321
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions AndroidManifest.template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PROCESS_TEXT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>

{wikipedia_activities}
Expand Down
5 changes: 5 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PROCESS_TEXT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>

<activity-alias
Expand Down
4 changes: 4 additions & 0 deletions src/itkach/aard2/ArticleCollectionActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ public Blob convert(Object item) {

private ArticleCollectionPagerAdapter createFromIntent(Application app, Intent intent) {
String lookupKey = intent.getStringExtra(Intent.EXTRA_TEXT);
if (intent.getAction().equals(Intent.ACTION_PROCESS_TEXT)) {
lookupKey = getIntent()
.getCharSequenceExtra(Intent.EXTRA_PROCESS_TEXT).toString();
}
if (lookupKey == null) {
lookupKey = intent.getStringExtra(SearchManager.QUERY);
}
Expand Down

0 comments on commit 4c17321

Please sign in to comment.