File tree Expand file tree Collapse file tree 3 files changed +24
-6
lines changed
java/com/fouflix/julesg10 Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 3232 android : exported =" true"
3333 android : label =" Ajouter dans FlouFlix"
3434 android : icon =" @drawable/flouflix_icon" >
35+
36+ <intent-filter >
37+ <action android : name =" android.intent.action.VIEW" />
38+ <category android : name =" android.intent.category.DEFAULT" />
39+ <category android : name =" android.intent.category.BROWSABLE" />
40+
41+ <data android : scheme =" file" />
42+ <data android : scheme =" content" />
43+ <data android : mimeType =" */*" />
44+ <data android : host =" *" />
45+ </intent-filter >
46+
3547 <intent-filter >
3648 <action android : name =" android.intent.action.PROCESS_TEXT" />
3749 <category android : name =" android.intent.category.DEFAULT" />
7688 <!-- Permissions -->
7789 <uses-permission android : name =" android.permission.INTERNET" />
7890 <uses-permission android : name =" android.permission.READ_EXTERNAL_STORAGE" />
79- <uses-permission android : name =" android.permission.READ_HISTORY_BOOKMARKS" />
8091</manifest >
Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ private String extractQuery(Intent intent)
4747
4848 private String extractFile (Intent intent ) {
4949 Uri file = intent .getParcelableExtra (Intent .EXTRA_STREAM );
50+ if (file == null )
51+ {
52+ file = intent .getData ();
53+ }
54+
5055 if (file == null ) return null ;
5156
5257 StringBuilder fileContent = new StringBuilder ();
Original file line number Diff line number Diff line change @@ -69,14 +69,16 @@ protected void handleOnNewIntent(Intent intent) {
6969 String text = intent .getStringExtra ("text" );
7070 String file = intent .getStringExtra ("file" );
7171
72- if (text == null && file == null )
72+ JSObject ret = new JSObject ();
73+ if (text != null )
7374 {
74- return ;
75+ ret . put ( "text" , text ) ;
7576 }
7677
77- JSObject ret = new JSObject ();
78- ret .put ("text" , text );
79- ret .put ("file" , file );
78+ if (file != null )
79+ {
80+ ret .put ("file" , file );
81+ }
8082
8183 this .notifyListeners (EVENT_SHARE_TEXT_DATA , ret , true );
8284 }
You can’t perform that action at this time.
0 commit comments