Skip to content

Commit

Permalink
remove context from constructor (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
SungjunApp authored Jan 18, 2023
1 parent 82f7c34 commit 005fead
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull
/**
* Created by sungjun on 9/18/20.
*/
class PXLClient(val context: Context) {
class PXLClient {
companion object{
val mediaType = "application/json; charset=utf-8".toMediaTypeOrNull()
private var mInstance: PXLClient? = null
Expand Down Expand Up @@ -46,16 +46,16 @@ class PXLClient(val context: Context) {
@Synchronized
fun getInstance(context: Context): PXLClient {
if (mInstance == null) {
mInstance = PXLClient(context)
mInstance = PXLClient()
android_id = Secure.getString(context.applicationContext.contentResolver, Secure.ANDROID_ID)
}
return mInstance!!
}
}

init {
requireNotNull(PXLClient.apiKey) { "no apiKey, please set apiKey before start" }
requireNotNull(apiKey) { "no apiKey, please set apiKey before start" }
Logger.addLogAdapter(AndroidLogAdapter())
android_id = Secure.getString(context.applicationContext.contentResolver, Secure.ANDROID_ID)
}

/**
Expand Down

0 comments on commit 005fead

Please sign in to comment.