From 2c6ede578f77517ccc3cc89d1f5025a942bb1be4 Mon Sep 17 00:00:00 2001 From: Mazen Rashed Date: Mon, 22 Apr 2019 00:40:40 +0300 Subject: [PATCH] Update MainActivity.kt --- app/src/main/java/com/mazenrashed/example/MainActivity.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/mazenrashed/example/MainActivity.kt b/app/src/main/java/com/mazenrashed/example/MainActivity.kt index c4a7b6d..d9c27ff 100644 --- a/app/src/main/java/com/mazenrashed/example/MainActivity.kt +++ b/app/src/main/java/com/mazenrashed/example/MainActivity.kt @@ -18,11 +18,13 @@ import kotlinx.android.synthetic.main.activity_main.* class MainActivity : AppCompatActivity() { - private val printing = Printooth.printer() - + private var printing : Printing? = null + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) + if (Printooth.hasPairedPrinter()) + printing = Printooth.printer() initViews() initListeners() } @@ -145,4 +147,4 @@ class MainActivity : AppCompatActivity() { printSomePrintable() initViews() } -} \ No newline at end of file +}