🐛 Fix connectivity issue
This commit is contained in:
parent
a9602368fb
commit
e67a4ea71b
@ -32,7 +32,7 @@ class FullNodeDialogActivity : Activity() {
|
||||
setContentView(R.layout.dialog_full_node)
|
||||
ok.setOnClickListener {
|
||||
preferences.wifiOnly = false
|
||||
network.enableNode()
|
||||
network.scheduleNodeStart()
|
||||
finish()
|
||||
}
|
||||
dismiss.setOnClickListener {
|
||||
|
@ -5,20 +5,14 @@ import android.content.Intent
|
||||
import android.support.v4.app.FragmentManager
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
|
||||
import com.mikepenz.materialdrawer.AccountHeader
|
||||
import com.mikepenz.materialdrawer.model.ProfileDrawerItem
|
||||
import com.mikepenz.materialdrawer.model.interfaces.IProfile
|
||||
|
||||
import ch.dissem.apps.abit.AddressDetailActivity
|
||||
import ch.dissem.apps.abit.AddressDetailFragment
|
||||
import ch.dissem.apps.abit.MainActivity
|
||||
import ch.dissem.apps.abit.R
|
||||
import android.widget.Toast.LENGTH_LONG
|
||||
import ch.dissem.apps.abit.*
|
||||
import ch.dissem.apps.abit.dialog.AddIdentityDialogFragment
|
||||
import ch.dissem.apps.abit.service.Singleton
|
||||
import ch.dissem.bitmessage.entity.BitmessageAddress
|
||||
|
||||
import android.widget.Toast.LENGTH_LONG
|
||||
import com.mikepenz.materialdrawer.AccountHeader
|
||||
import com.mikepenz.materialdrawer.model.ProfileDrawerItem
|
||||
import com.mikepenz.materialdrawer.model.interfaces.IProfile
|
||||
|
||||
class ProfileSelectionListener(
|
||||
private val ctx: Context,
|
||||
|
@ -34,6 +34,11 @@ class NodeStartupService : JobService() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
notification = NetworkNotification(this)
|
||||
}
|
||||
|
||||
override fun onStartJob(params: JobParameters?): Boolean {
|
||||
if (preferences.online) {
|
||||
registerReceiver(
|
||||
@ -43,7 +48,6 @@ class NodeStartupService : JobService() {
|
||||
addAction(Intent.ACTION_BATTERY_CHANGED)
|
||||
}
|
||||
)
|
||||
notification = NetworkNotification(this)
|
||||
NodeStartupService.running = false
|
||||
|
||||
if (!isRunning) {
|
||||
@ -67,7 +71,12 @@ class NodeStartupService : JobService() {
|
||||
doAsync {
|
||||
bmc.cleanup()
|
||||
}
|
||||
try {
|
||||
unregisterReceiver(connectivityReceiver)
|
||||
} catch (_: IllegalArgumentException) {
|
||||
// For some reason, onStartJob wasn't called so the receiver isn't registered.
|
||||
// Let's just ignore this.
|
||||
}
|
||||
stopSelf()
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ import ch.dissem.apps.abit.adapter.SwipeableMessageAdapter
|
||||
import ch.dissem.apps.abit.listener.MessageListener
|
||||
import ch.dissem.apps.abit.repository.*
|
||||
import ch.dissem.apps.abit.util.Observable
|
||||
import ch.dissem.apps.abit.util.preferences
|
||||
import ch.dissem.bitmessage.BitmessageContext
|
||||
import ch.dissem.bitmessage.cryptography.sc.SpongyCryptography
|
||||
import ch.dissem.bitmessage.entity.BitmessageAddress
|
||||
|
Loading…
Reference in New Issue
Block a user