Skip to content

Instantly share code, notes, and snippets.

View radzio's full-sized avatar
👨‍💻
Coding

Radek Piekarz radzio

👨‍💻
Coding
View GitHub Profile
@radzio
radzio / README.md
Created October 11, 2023 10:37 — forked from raahede/README.md
Handle multiple GitHub accounts on Mac
class LiveEvent<T> : MediatorLiveData<T>() {
private val observers = ConcurrentHashMap<LifecycleOwner, MutableSet<ObserverWrapper<T>>>()
@MainThread
override fun observe(owner: LifecycleOwner, observer: Observer<T>) {
val wrapper = ObserverWrapper(observer)
val set = observers[owner]
set?.apply {
add(wrapper)
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
/*
Xively MQTT example
-Subscribes to Xively feed
-publishes current value to serial monitor
Based on Basic MQTT Example by knolleary
By Calum Barnes, Xively (c) 2013