Skip to content

Commit

Permalink
Supressing unchekced cast on method create
Browse files Browse the repository at this point in the history
  • Loading branch information
Maliotis committed Apr 23, 2021
1 parent 71817ee commit 464fb35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ class LargeTests {
val scenario = launchActivity<TestActivityForNFCLib>()
scenario.moveToState(Lifecycle.State.RESUMED)
scenario.onActivity { activity ->
val readNFCFactory = NFCFactory.create<ReadNFC>(activity)
val readNFC = readNFCFactory.getNFC()
val readNFC = NFCFactory.create<ReadNFC>(activity)
readNFC.enableNFCInForeground()

val ndefBundle = Bundle()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.maliotis.library.factories

import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.content.Intent
Expand Down Expand Up @@ -37,6 +38,7 @@ abstract class NFCFactory<T: NFC> {
/**
* Java alternative method
*/
@Suppress("UNCHECKED_CAST")
@JvmStatic
fun <T: NFC> create(typeOf: Class<T>, activity: Activity): T {
this.nfcManager = activity.getSystemService(Context.NFC_SERVICE) as NfcManager
Expand Down

0 comments on commit 464fb35

Please sign in to comment.