Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Commit

Permalink
Optimize and update configuration information
Browse files Browse the repository at this point in the history
  • Loading branch information
zerorooot committed May 22, 2022
1 parent 576f3e0 commit bc7b02d
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package github.zerorooot.fuckbilibilivote

import android.R
import android.content.ComponentName
import android.content.Context
import android.content.SharedPreferences
Expand Down Expand Up @@ -121,16 +120,15 @@ class MainActivity : AppCompatActivity() {
Handler(Looper.getMainLooper()).post {
Toast.makeText(
application,
"download success,please restart this app",
"update success,please restart this app",
Toast.LENGTH_SHORT
).show()
}

} catch (e: Exception) {
Handler(Looper.getMainLooper()).post {
Toast.makeText(application, "download error", Toast.LENGTH_SHORT).show()
Toast.makeText(application, "download error \n${e.message.toString()}", Toast.LENGTH_LONG).show()
}
e.printStackTrace()
}
}.start()
}
Expand All @@ -141,7 +139,7 @@ class MainActivity : AppCompatActivity() {
Toast.makeText(applicationContext, "save success", Toast.LENGTH_SHORT).show()
}
binding.saveButton.setOnLongClickListener {
Toast.makeText(application, "start download", Toast.LENGTH_SHORT).show()
Toast.makeText(application, "start update config", Toast.LENGTH_SHORT).show()
httpConnect()
true
}
Expand All @@ -164,10 +162,10 @@ class MainActivity : AppCompatActivity() {

val adapter = ArrayAdapter(
this,
R.layout.simple_spinner_item,
android.R.layout.simple_spinner_item,
array
)
adapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item)
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
spinner.adapter = adapter
spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onNothingSelected(parent: AdapterView<*>?) {
Expand Down

0 comments on commit bc7b02d

Please sign in to comment.