Skip to content

Commit

Permalink
Removed UI-thread useless calls
Browse files Browse the repository at this point in the history
  • Loading branch information
cioccarellia committed Mar 27, 2019
1 parent 793fabd commit 8b8c936
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,12 @@ open class PresentationActivity : AppCompatActivity() {
prefs.put(key, jsonErrorLog)
val jsonFromPrefs = JSONObject(prefs.get(key, ""))

toast(jsonFromPrefs.getString("details"))

updateView()
}


button3.setOnClickListener {
// Function that will return back the number of times the app has started
toast(prefs.get(Keys.startCount, 0))
prefs.put("A", "B")
updateView()
}
Expand Down Expand Up @@ -102,7 +99,6 @@ open class PresentationActivity : AppCompatActivity() {

prefs.remove("A")
updateView()
toast(x)
}

button6.setOnClickListener {
Expand Down Expand Up @@ -131,12 +127,6 @@ open class PresentationActivity : AppCompatActivity() {
content.text = "${content.text}\n\n\n"
}

private fun Context.toast(message: Any?) {
try {
Toast.makeText(applicationContext, message.toString(), Toast.LENGTH_LONG).show()
} catch (e: WindowManager.BadTokenException) {}
}

override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_presentation, menu)
return true
Expand Down

0 comments on commit 8b8c936

Please sign in to comment.