File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import Foundation
99import AndroidKit
1010import JavaLang
11+ import Binder
1112
1213@JavaClass ( " com.pureswift.swiftandroid.MainActivity " )
1314open class MainActivity: AndroidApp . Activity {
@@ -56,6 +57,10 @@ private extension MainActivity {
5657
5758 // need to recreate views
5859 setRootView ( )
60+
61+ Task {
62+ printBinderVersion ( )
63+ }
5964 }
6065
6166 func runAsync( ) {
@@ -310,6 +315,17 @@ private extension MainActivity {
310315 . add ( 2001 , fragment1)
311316 . commit ( )
312317 }
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+ }
313329}
314330
315331extension MainActivity {
@@ -338,5 +354,8 @@ extension MainActivity {
338354 func logError( _ string: String ) {
339355 Self . logError ( string)
340356 }
357+
358+ func logInfo( _ string: String ) {
359+ Self . logInfo ( string)
360+ }
341361}
342-
You can’t perform that action at this time.
0 commit comments