Skip to content

Instantly share code, notes, and snippets.

View rjsvieira's full-sized avatar

Ricardo Vieira rjsvieira

View GitHub Profile
@jonikarppinen
jonikarppinen / 1_RxJava-connectivity-status-example.md
Last active November 23, 2022 18:16
Example of listening to connectivity status in Android and reacting to going offline. (Subscription, Observable, Observer, PublishSubject are from RxJava.)

Example of using RxJava to listen to connectivity status in Android

You could use the same approach to listen to any status, but this example includes network connectivity specifics too (ConnectionChangeReceiver and AndroidUtils.isConnected).

@henteko
henteko / AndroidManifest.xml
Created August 7, 2014 14:09
gradle.properties->build.gradle->AndroidManifest.xml->javaへの値渡し
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.henteko07.sampleandroidproject" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
@staltz
staltz / introrx.md
Last active September 20, 2024 10:10
The introduction to Reactive Programming you've been missing
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@Joev-
Joev- / DialogFragmentCallback.md
Last active June 25, 2021 08:43
Getting results from DialogFragment to calling Fragment using Callbacks

##Getting results from DialogFragments to another Fragment.

When setting up the DialogFragment make a call to Fragment.setTargetFragment()
Then from DialogFragment you can access the main fragment with Fragment.getTargetFragment()
Use interfaces to provide the required actions to the calling Fragment.

##Example code.

###AddFriendDialogFragment - Calls back to calling fragment.