Action android.intent.action.PROCESS_TEX doesn't send any data selected by user
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- android, typescript
- Domaine
- mobile
Piste de recherche
La reproduction utilise AndroidManifest.xml et le gestionnaire activityCreatedEvent dans main.ts ; commencez par exécuter les étapes PROCESS_TEXT indiquées et vérifier les données de l’intent. C’est terminé lorsque le texte sélectionné dans le navigateur est disponible via EXTRA_TEXT à l’ouverture de l’application.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- NS: "7.0.8",
- CLI: 10.1.7
To Reproduce
- create new app: tns create app-name -ng
- Add next intent-filter to activity in AndroidManifest.xml
(...)
<intent-filter>
<action android:name="android.intent.action.PROCESS_TEXT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
(...)
- Add to main.ts code below:
application.android.on(
application.AndroidApplication.activityCreatedEvent,
function (args) {
const activity = args.activity;
// Get intent, action and MIME type
const intent = activity.getIntent();
const action = intent.getAction();
const type = intent.getType();
if (action === "android.intent.action.PROCESS_TEXT" && type != null) {
console.log("Ok");
if (type.startsWith("text/")) {
console.log("Ok");
let sharedText = intent.getStringExtra(android.content.Intent.EXTRA_TEXT);
console.log("sharedText", sharedText); // Not ok -> null
}
}
}
);
- run: tns run android
- Open android browser and select some text
- Context menu is showing properly in context menu -> click
- User app is opened but console log is not showing selected text
Additional context
{
"name": "@nativescript/template-hello-world-ng",
"main": "main.js",
"version": "7.0.8",
"author": "NativeScript Team <oss@nativescript.org>",
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"publishConfig": {
"access": "public"
},
"keywords": [
"nativescript",
"mobile",
"angular",
"{N}",
"template"
],
"repository": "<fill-your-repository-here>",
"bugs": {
"url": "https://github.com/NativeScript/NativeScript/issues"
},
"dependencies": {
"@angular/animations": "~11.0.0",
"@angular/common": "~11.0.0",
"@angular/compiler": "~11.0.0",
"@angular/core": "~11.0.0",
"@angular/forms": "~11.0.0",
"@angular/platform-browser": "~11.0.0",
"@angular/platform-browser-dynamic": "~11.0.0",
"@angular/router": "~11.0.0",
"@nativescript/angular": "~11.0.0",
"@nativescript/core": "~7.0.0",
"@nativescript/theme": "~3.0.0",
"reflect-metadata": "~0.1.12",
"rxjs": "^6.6.0",
"zone.js": "~0.11.1"
},
"devDependencies": {
"@angular/compiler-cli": "~11.0.0",
"@nativescript/android": "7.0.1",
"@nativescript/types": "~7.0.0",
"@nativescript/webpack": "~3.0.0",
"@ngtools/webpack": "~11.0.0",
"typescript": "~4.0.0"
},
"gitHead": "41a7254d3bc134fd3c258761f3c6e1c3d54e6d41",
"private": "true",
"readme": "NativeScript Application"
}
- Langage dominant
- C++
- Étoiles
- 563
- Forks
- 144
- Merge moyen
- 10 h 46 min
- PR mergées (30 j)
- 14
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de NativeScript/android
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 38/100
NativeScript/android#2039 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
NativeScript/android#2024 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 20/100
NativeScript/android#2020 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 42/100
NativeScript/android#2019 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
NativeScript/android#1986 ·
Toutes les issues de NativeScript/android
Issues similaires
-
Website Doc Typo Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
-
Difficulté 1/5 1-3 heures Accessibilité débutants 92/100
autowarefoundation/autoware_universe#13413 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
automated-analysis bug memory-safety
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100