File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
pythonforandroid/bootstraps/qt5/build/src/main/java/org/kivy/android Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -160,5 +160,40 @@ protected void onPostExecute(String result) {
160
160
}
161
161
}
162
162
163
+ //----------------------------------------------------------------------------
164
+ // Listener interface for onNewIntent
165
+ //
166
+
167
+ public interface NewIntentListener {
168
+ void onNewIntent (Intent intent );
169
+ }
170
+
171
+ private List <NewIntentListener > newIntentListeners = null ;
172
+
173
+ public void registerNewIntentListener (NewIntentListener listener ) {
174
+ if ( this .newIntentListeners == null )
175
+ this .newIntentListeners = Collections .synchronizedList (new ArrayList <NewIntentListener >());
176
+ this .newIntentListeners .add (listener );
177
+ }
178
+
179
+ public void unregisterNewIntentListener (NewIntentListener listener ) {
180
+ if ( this .newIntentListeners == null )
181
+ return ;
182
+ this .newIntentListeners .remove (listener );
183
+ }
184
+
185
+ @ Override
186
+ protected void onNewIntent (Intent intent ) {
187
+ if ( this .newIntentListeners == null )
188
+ return ;
189
+ this .onResume ();
190
+ synchronized ( this .newIntentListeners ) {
191
+ Iterator <NewIntentListener > iterator = this .newIntentListeners .iterator ();
192
+ while ( iterator .hasNext () ) {
193
+ (iterator .next ()).onNewIntent (intent );
194
+ }
195
+ }
196
+ }
197
+
163
198
}
164
199
You can’t perform that action at this time.
0 commit comments