File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 8
8
import Foundation
9
9
import AndroidKit
10
10
import JavaLang
11
+ import Binder
11
12
12
13
@JavaClass ( " com.pureswift.swiftandroid.MainActivity " )
13
14
open class MainActivity: AndroidApp . Activity {
@@ -56,6 +57,10 @@ private extension MainActivity {
56
57
57
58
// need to recreate views
58
59
setRootView ( )
60
+
61
+ Task {
62
+ printBinderVersion ( )
63
+ }
59
64
}
60
65
61
66
func runAsync( ) {
@@ -310,6 +315,17 @@ private extension MainActivity {
310
315
. add ( 2001 , fragment1)
311
316
. commit ( )
312
317
}
318
+
319
+ private func printBinderVersion( ) {
320
+ // Print Binder version
321
+ do {
322
+ let version = try BinderVersion . current
323
+ logInfo ( " Binder Version: \( version) " )
324
+ }
325
+ catch {
326
+ logError ( " Unable to read binder: \( error) " )
327
+ }
328
+ }
313
329
}
314
330
315
331
extension MainActivity {
@@ -338,5 +354,8 @@ extension MainActivity {
338
354
func logError( _ string: String ) {
339
355
Self . logError ( string)
340
356
}
357
+
358
+ func logInfo( _ string: String ) {
359
+ Self . logInfo ( string)
360
+ }
341
361
}
342
-
You can’t perform that action at this time.
0 commit comments