I am trying to do an app where I want to update a ProgressBar in a for loop using AsyncTask. The best is to show you a pseudo code of what I am trying to do
button.setOnClickListener{
for(int i=0; i<5000; i++)
{
doSomeHeavyStuff();
UpdateProgressBarAsyncTask(i).execute()
}
}
This is what I have so far
MainActivity:
class MainActivity : AppCompatActivity() {
var progress:ProgressBar? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
progress = findViewById(R.id.progress)
val buttonStart = findViewById<TextView>(R.id.button)
var maxNumber = 5000
buttonStart.setOnClickListener{
for(i in 0 until maxNumber)
{
HeavyStuff()
ProgressTask(i,progress!!,maxNumber,this).execute()
}
}
}
internal class ProgressTask (var actual:Int, var progress: ProgressBar, var max: Int, var context: Activity): AsyncTask <Void, Int, Int>()
{
override fun onPreExecute() {
super.onPreExecute()
progress.visibility = View.VISIBLE
progress.max = max
}
override fun onProgressUpdate(vararg values: Int?) {
super.onProgressUpdate(*values)
progress.setProgress(values[0]!!)
}
override fun doInBackground(vararg params: Void?): Int? {
publishProgress(actual)
return null
}
override fun onPostExecute(result: Int?) {
super.onPostExecute(result)
progress.visibility = View.INVISIBLE
Toast.makeText(context, "Finished!", Toast.LENGTH_SHORT).show()
}
}
XML:
<ProgressBar
android:id="#+id/progress"
style="#android:style/Widget.ProgressBar.Horizontal"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:layout_marginRight="24dp"
android:layout_marginBottom="24dp"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Do I miss something here? Right now it shows ProgressBar after the HeavyStuff() is finished and thus it is not shown during the for loop. What am I missing here?
Can you guys please help me with this?
Thanks
Actually, I think that both the heavy stuff and the For Loop need to be present inside of the doBackground function (The call of heavy stuff in the main thread will freeze the UI and cause an ANR), see the code below :
const val max = 50000
class MainActivity : AppCompatActivity() {
var progress: ProgressBar? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
progress = findViewById(R.id.progress)
buttonStart.setOnClickListener {
ProgressTask(progress!!, max, this).execute()
}
}
internal class ProgressTask(
var progress: ProgressBar,
var max: Int,
var context: Activity
) : AsyncTask<Void, Int, Int>() {
override fun onPreExecute() {
super.onPreExecute()
progress.visibility = View.VISIBLE
progress.max = max
}
override fun onProgressUpdate(vararg values: Int?) {
super.onProgressUpdate(*values)
progress.setProgress(values[0]!!)
}
override fun doInBackground(vararg params: Void?): Int? {
for (i in 0 until max) {
doHeavyStuff()
publishProgress(i)
}
return null
}
override fun onPostExecute(result: Int?) {
super.onPostExecute(result)
progress.visibility = View.INVISIBLE
Toast.makeText(context, "Finished!", Toast.LENGTH_SHORT).show()
}
}
}
I would go with this approach to avoid memory leaks:
private lateinit var mTextView: WeakReference<TextView>
private lateinit var mProgressBar: WeakReference<ProgressBar>
private const val MAX = 50000
class ProgressTask(
pb: ProgressBar,
var max: Int
) : AsyncTask<Void, Int, Int>() {
init {
mProgressBar = WeakReference(pb)
}
override fun onPreExecute() {
super.onPreExecute()
mProgressBar.get()?.visibility = View.VISIBLE
mProgressBar.get()?.max = MAX
}
override fun onProgressUpdate(vararg values: Int?) {
super.onProgressUpdate(*values)
mProgressBar.get()?.progress = values[0]!!
}
override fun doInBackground(vararg p0: Void?): Int {
for (i in 0 until MAX) {
doHeavyStuff()
publishProgress(i)
}
return 1
}
override fun onPostExecute(result: Int?) {
super.onPostExecute(result)
mProgressBar.get()?.visibility = View.GONE
}
}
Related
I'm new in Kotlin and I want to use three Seekbar on my app for RGB control;
I want to set seekBarManger function to manage my seekbar on SeekBarManger class and use seekbar.progress value on other class
but I cant get value of my seekbar.
the Toast is Show but I want to use the value of seekbar.progrees in other method and class.
please help me..!!!!
this is my seekbar class :
class SeekBarManager() {
}
fun seekBarManage(context: Context, seekBar: SeekBar) {
seekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) { }
override fun onStartTrackingTouch(p0: SeekBar?) {}
override fun onStopTrackingTouch(p0: SeekBar?) {
val result = seekBar.progress
Toast.makeText(context, "Progress is: $result%", Toast.LENGTH_SHORT).show()
}
})
and this is my MainActivity :
open class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val seekRed = findViewById<SeekBar>(R.id.seekBar_red)
val seekGreen = findViewById<SeekBar>(R.id.seekBar_green)
val seekBlue = findViewById<SeekBar>(R.id.seekBar_blue)
val seekEndRed = seekBarManage(this , seekRed)
val seekEndGreen = seekBarManage(this , seekGreen)
val seekEndBlue = seekBarManage(this , seekBlue)
the Toast is Show but I want to use the value of seekbar.progrees in other method and class
the easiest way is to use a companion object in your Main class and just call a method and pass your seek bar object like below :
open class MainActivity : AppCompatActivity() {
companion object {
fun getSeekBarProgress(context: Context, seekBar: SeekBar) {
val result = seekBar.progress
Toast.makeText(context, "Progress is: $result%", Toast.LENGTH_SHORT).show()
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val seekRed = findViewById<SeekBar>(R.id.seekBar_red)
val seekGreen = findViewById<SeekBar>(R.id.seekBar_green)
val seekBlue = findViewById<SeekBar>(R.id.seekBar_blue)
val seekEndRed = seekBarManage(this, seekRed)
val seekEndGreen = seekBarManage(this, seekGreen)
val seekEndBlue = seekBarManage(this, seekBlue)
}
}
and SeekBarManager class :
class SeekBarManager() {
}
fun seekBarManage(context: Context, seekBar: SeekBar) {
seekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {}
override fun onStartTrackingTouch(p0: SeekBar?) {}
override fun onStopTrackingTouch(p0: SeekBar?) {
MainActivity.getSeekBarProgress(context, seekBar)
}
})
}
I am using Android LiveData in 3 different EditText. I have to show the result of multiplying the values of the first two EditText into the third EditText. I took advantage of an advice given to me on this site, and actually the third value is updated with the result of the multiplication of the first two. The problem is that the update does not happen live, but only happens when I leave and re-enter the activity. I am attaching the XML file, the activity, and the viewmodel.
XML:
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
tools:context=".MainActivity">
<EditText
android:id="#+id/num1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:backgroundTint="#color/white"
android:inputType="number" />
<EditText
android:id="#+id/num2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:backgroundTint="#color/white"
android:inputType="numberDecimal" />
<EditText
android:id="#+id/num3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:backgroundTint="#color/white"
android:inputType="numberDecimal" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Activity
class MainActivity: AppCompatActivity() {
private lateinit var binding: MainActivityBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.main_activity)
binding = DataBindingUtil.setContentView(
this,
R.layout.main_activity
)
viewModel=
ViewModelProvider(this, factory)[MainActivityViewModel::class.java]
initView(binding)
}
private fun initView(
binding:
MainActivityBinding
) {
viewModel.num1.value = root?.num1?: 0
viewModel.num2.value = root?.num2?: 0.0
viewModel.num1.observe(lifecycleOwner, Observer { newNum1->
binding.num1.setText(
newNum1.toString()
)
})
viewModel.num2.observe(lifecycleOwner, Observer { newNum2->
binding.num2.setText(
newNum2.toString()
)
})
binding.num1.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
viewModel.num1.value =
binding.num1.text?.toString()?.toInt()
?: 0
}
override fun beforeTextChanged(
s: CharSequence?,
start: Int,
count: Int,
after: Int
) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
})
binding.num2.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
viewModel.num2.value =
binding.num2.text?.toString()?.toDouble()
?: 0.0
}
override fun beforeTextChanged(
s: CharSequence?,
start: Int,
count: Int,
after: Int
) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
})
fun <A, B> LiveData<A>.combineWith(b: LiveData<B>): LiveData<Pair<A?, B?>> =
MediatorLiveData<Pair<A?, B?>>().apply {
var lastA: A? = this#combineWith.value
var lastB: B? = b.value
addSource(this#combineWith) {
lastA = it
value = Pair(lastA, lastB)
}
addSource(b) {
lastB = it
value = Pair(lastA, lastB)
}
}
viewModel.num1.combineWith(viewModel.num2)
.observe(
this,
Observer { (first, second) ->
if (first != null && second != null) {
binding.num3.setText((first * second).toString())
}
}
)
}
binding.num1.isFocusableInTouchMode = true
binding.num2.isFocusableInTouchMode = true
binding.num3.isFocusableInTouchMode = true
}
}
ViewModel
class RapportiAltriCostiViewModel(private val repositoryDB: DbRepository) : ViewModel() {
var num1= MutableLiveData<Int>()
var num2= MutableLiveData<Double>()
}
Would anyone know how to solve?
Thank you for your patience and help!
UPDATE
I tried with TextWatcher but it goes in loop:
binding.num1.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
viewModel.num1.value =
binding.num1.text?.toString()?.toInt()
?: 0
}
override fun beforeTextChanged(
s: CharSequence?,
start: Int,
count: Int,
after: Int
) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
})
binding.num2.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
viewModel.num2.value =
binding.num2.text?.toString()?.toDouble()
?: 0.0
}
override fun beforeTextChanged(
s: CharSequence?,
start: Int,
count: Int,
after: Int
) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
})
And I can't remove the TextWatcher after assigning the value, as I read on another question on the site, because I need them to always listen.
Thanks for the patience once again!
Something similar to this. To avoid cyclic updates you may just compare new value inside onFirstChanged/onSecondChanged with value in your liveData and skip liveData.value = newValue in that way.
class MainActivity : AppCompatActivity() {
private lateinit var binding: MainActivityBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.main_activity)
binding = DataBindingUtil.setContentView(
this,
R.layout.main_activity
)
viewModel =
ViewModelProvider(this, factory)[MainActivityViewModel::class.java]
initView(binding)
}
private fun initView(
binding:
MainActivityBinding
) {
binding.num1.listenChanges { viewModel.onFirstChanged(it) }
binding.num2.listenChanges { viewModel.onSecondChanged(it) }
viewModel.num1
.observe(
lifecycleOwner,
Observer { num1Value ->
binding.num1.setText(num1Value.toString())
}
)
viewModel.num2
.observe(
lifecycleOwner,
Observer { num2Value ->
binding.num2.setText(num2Value.toString())
}
)
viewModel.num3
.observe(
lifecycleOwner,
Observer { result ->
binding.num3.setText(result.toString())
}
)
}
binding.num1.isFocusableInTouchMode = true
binding.num2.isFocusableInTouchMode = true
binding.num3.isFocusableInTouchMode = true
}
private fun EditText.listenChanges(textChanged: (String) -> Unit) {
addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
textChanged(s.toString())
}
})
}
class RapportiAltriCostiViewModel(private val repositoryDB: DbRepository) : ViewModel() {
val num1 = MutableLiveData<Int>(0)
val num2 = MutableLiveData<Double>(0.0)
val num3: LiveData<Double>
get() = num1.combineWith(num2) { first, second ->
(first ?: 0) * (second ?: 0.0)
}
fun onFirstChanged(newValue: Int) {
if (num1.value != newValue) {
num1.value = newValue
}
}
fun onSecondChanged(newValue: Double) {
if (num2.value != newValue) {
num2.value = newValue
}
}
private companion object {
private fun <A, B, R> LiveData<A>.combineWith(b: LiveData<B>, combine: (A?, B?) -> R?): LiveData<R> =
MediatorLiveData<R>().apply {
var lastA: A? = this#combineWith.value
var lastB: B? = b.value
addSource(this#combineWith) {
lastA = it
value = combine.invoke(lastA, lastB)
}
addSource(b) {
lastB = it
value = combine.invoke(lastA, lastB)
}
}
}
}
I want to parse JSON from this URL https://swapi.dev/api/films/
Here my activity_mail.xml
<ListView
android:id="#+id/mylist"
android:layout_width="match_parent"
android:layout_height="match_parent" />
And here my MainActivity
class MainActivity : AppCompatActivity() {
lateinit var pDialog: ProgressDialog
lateinit var listView: ListView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val url="https://swapi.dev/api/films/"
}
inner class AsyncTaskHandler:AsyncTask<String, String, String>() {
override fun onPreExecute() {
super.onPreExecute()
pDialog= ProgressDialog(this#MainActivity)
pDialog.setMessage("Please Wait")
pDialog.setCancelable(false)
pDialog.show()
}
override fun doInBackground(vararg url: String?): String {
//TODO("Not yet implemented")
val res:String
val connection=URL(url[0]).openConnection()as HttpURLConnection
try {
connection.connect()
res=connection.inputStream.use { it.reader().use { reader->reader.readText()} }
}
finally {
connection.disconnect()
}
return res
}
override fun onPostExecute(result: String?) {
super.onPostExecute(result)
jsonResult(result)
if(pDialog.isShowing())
pDialog.dismiss()
}
private fun jsonResult(jsonString: String?) {
val jsonArray=JSONArray(jsonString)
val list=ArrayList<MyData>()
var i = 0
while (i<jsonArray.length())
{
val jsonObject=jsonArray.getJSONObject(i)
list.add(
MyData(
jsonObject.getString("title"),
jsonObject.getInt("episode_id"),
jsonObject.getString("opening_crawl"),
jsonObject.getString("director"),
jsonObject.getString("producer"),
jsonObject.getString("release_date")
)
)
i++
}
val adapter=ListAdapter(this#MainActivity,list)
mylist.adapter=adapter
}
}
}
The problem is that he dont find my listview "mylist". I put a id but at the end of the file i have this error : "Unresolved reference: mylist"
Maybe something like that ? (ListView)(R.id.mylist).adapter=adapter
R.layout.activity_main change to R.layout.activity_mail
I'm new here and this is my first post!
I try to learn Android app development and I'm stuck with this problem :
How can I update a textview inside a function? I code a small app which generates all the permutation with repetitions and write it in a textview.
It works, but the textview updates only at the end of all the permutations... Don't understand why...
Sorry if my English is bad, I'm French ;)
I try to use Thread, the app doesn't crash, it seems to work but the app goes directly in the background...
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
permutation2("abcdefgh", 8)
}
private fun permutation1(text: String, prefix: String, n: Int, k: Int): String {
if (k == 0) {
} else
for (i in 0..n) {
val newprefix = prefix + text[i]
if (newprefix.length >= text.length) {
zoneTexte.text = newprefix
}
permutation1(text, newprefix, n, k - 1)
}
return "Erreur"
}
private fun permutation2(text: String, k: Int) {
permutation1(text, "", text.length - 1, k)
}
}
Functions for permutations work well but the textview update only at the end (with the last permutation "hhhhhhhh") and I would like to update it for each permutation.
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
permutation2("abcdefgh", 8)
}
private fun permutation2(text: String, k: Int) {
MyCal().execute(text)
}
inner class MyCal : AsyncTask<String ,String, String>(){
override fun onProgressUpdate(vararg values: String?) {
super.onProgressUpdate(*values)
zoneTexte.text = values[0]
}
override fun onPostExecute(result: String?) {
super.onPostExecute(result)
zoneTexte.text = result
}
override fun doInBackground(vararg p0: String?): String {
return permutation1(p0[0]!!, "", p0[0]!!.length?.minus(1), 8)
}
fun permutation1(text: String, prefix: String, n: Int, k: Int): String {
if (k == 0) {
} else
for (i in 0..n) {
val newprefix = prefix + text[i]
if (newprefix.length >= text.length) {
onProgressUpdate(newprefix)
return newprefix
}
permutation1(text, newprefix, n, k - 1)
}
return "Erreur"
}
}
}
onCreate is executed on the ui-thread, as is the case for permutation1() and permutation2(). The ui won't actually refresh until onCreate completes and ui can then refresh/redraw the screen, so that's why you don't see any incremental text updates until the end.
If you would like to see it update in real time, you may want to look into AsyncTask. In your particular example, you aren't really performing a long running task, so I'm not sure if you'll be able to see the incremental additions to your TextView even if you use AsyncTask.
After the help from Mark and Kishan I find the solution ! Thank you guys !
Here is the code :
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
permutation2("abcdefgh", 8)
}
private fun permutation2(text: String, k: Int) {
MyCal().execute(text)
}
inner class MyCal : AsyncTask<String ,String, String>(){
override fun onProgressUpdate(vararg values: String?) {
super.onProgressUpdate(*values)
runOnUiThread(Runnable { zoneTexte.text = values[0] })
}
override fun onPostExecute(result: String?) {
super.onPostExecute(result)
runOnUiThread(Runnable { zoneTexte.text = result })
}
override fun doInBackground(vararg p0: String?): String {
return permutation1(p0[0]!!, "", p0[0]!!.length?.minus(1), 8)
}
fun permutation1(text: String, prefix: String, n: Int, k: Int): String {
if (k == 0) {
} else
for (i in 0..n) {
val newprefix = prefix + text[i]
if (newprefix.length >= text.length) {
onProgressUpdate(newprefix)
return newprefix
}
permutation1(text, newprefix, n, k - 1)
}
return "Erreur"
}
}
}
I have an activity that calls a class and runs a function in that class like so:
for (i in 0 until questions) {
droll.droolCalls(sign)
}
This can sometimes run forever as it has to generate a bunch of random numbers, so I want it to be able to run in the background. I wrote an AsyncTask that looks like this:
class MyAsync(
private val droll: CreateLayout,
private val questions: Int, private val sign:Int,
var progressBar: ProgressBar,
var layoutProgress: LinearLayout,
var layoutMain: LinearLayout
) :
AsyncTask<String, Int, CreateLayout>() {
var progress = 0
override fun doInBackground(vararg params: String?): CreateLayout {
for (i in 0 until questions) {
droll.droolCalls(sign)
}
return droll
}
override fun onProgressUpdate(vararg values: Int?) {
super.onProgressUpdate(*values)
progressBar.incrementProgressBy(progress * 10)
}
override fun onPostExecute(result: CreateLayout?) {
super.onPostExecute(result)
layoutProgress.visibility = View.GONE
layoutMain.visibility = View.VISIBLE
}
}
However, when i call the drollclass
MyAsync(droll, totalQuestions,sign, progressBar, Loading, mainLayout).execute("hello")
i get an error from other functions that require drool to run.
this one for example insert_point.addView(droll.makeTextView(numberOfQuestions - 1)) gives me a java.lang.IndexOutOfBoundsException: Index: 2, Size: 0 error because insert_point not getting the data from droll because the Async didn't run? however if i take it out of the Async the for loop our of the Async it works fine.
the whole structure looks something like this
class mainclass{
MyAsync(droll, totalQuestions,sign, progressBar, Loading, mainLayout).execute("hello")
insert_point.addView(droll.makeTextView(numberOfQuestions - 1))
class MyAsync(
private val droll: CreateLayout,
private val questions: Int, private val sign:Int,
var progressBar: ProgressBar,
var layoutProgress: LinearLayout,
var layoutMain: LinearLayout
) :
AsyncTask<String, Int, CreateLayout>() {
var progress = 0
override fun doInBackground(vararg params: String?): CreateLayout {
for (i in 0 until questions) {
droll.droolCalls(sign)
}
return droll
}
override fun onProgressUpdate(vararg values: Int?) {
super.onProgressUpdate(*values)
progressBar.incrementProgressBy(progress * 10)
}
override fun onPostExecute(result: CreateLayout?) {
super.onPostExecute(result)
layoutProgress.visibility = View.GONE
layoutMain.visibility = View.VISIBLE
}
}
}
package www.binexmining.co.`in`.binexmining.binexmining.uam.view.activity
import android.app.Activity
import android.os.AsyncTask
import android.os.Bundle
import android.support.annotation.MainThread
import kotlinx.android.synthetic.main.row_referraluser.view.*
import www.binexmining.co.`in`.binexmining.R
class AsynTaskKotlinMain : Activity()
{
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_landing)
}
override fun onResume() {
super.onResume()
MyAssyn().execute("Pre-Executing Param Put here...","Param For Doinbackgroun")
}
}
class MyAssyn : AsyncTask<Any, Any, Any>()
{
override fun onPreExecute() {
super.onPreExecute()
}
override fun doInBackground(vararg params: Any?) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun onPostExecute(result: Any?) {
super.onPostExecute(result)
}
}