Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 41ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
A

Android

Recently created Least recently created Recently updated Least recently updated
radimkliment

radimkliment / Service

Last active 4 months ago Android

Implementation of service, bounded service in Android

0 0 4
1 // without bound
2 override fun onStart() {
3 super.onStart()
4 val intent = Intent(this, HelloService::class.java)
5 startService(intent)
6 }
7
8 // with bound
9 private lateinit var mService: LocalService
10 private var mBound: Boolean = false
radimkliment

radimkliment / BroadcastReceiver

Last active 4 months ago Android

Implementation of broadcast receivers: implicit, explicit, static, dynamic

0 0 4
1 public class MyBroadcastReceiver : BroadcastReceiver() {
2 override fun onReceive(context : Context, intent: Intent) {
3
4 }
5 }
6
7 BroadcastReceiver myBroadcastReceiver = new MyBroadcastReceiver();
8 IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
9 filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED);