Skip to content

Instantly share code, notes, and snippets.

View RegisterActivity.kt
package com.example.monpfe
import android.app.ProgressDialog
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import android.util.Log
import android.widget.Button
import android.widget.EditText
@gavelez
gavelez / AndroidManifest.xml
Created Apr 20, 2020
How to detect call state Android
View AndroidManifest.xml
<receiver android:name=".CallReceiver" >
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>
</receiver>
@gavelez
gavelez / AndroidManifest.xml
Last active Dec 23, 2019
ExoPlayer multiformat playing
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@gavelez
gavelez / CollectionWrapper.kt
Last active Nov 28, 2019
Use of Generics with Gson
View CollectionWrapper.kt
package com.example.util
import com.example.MyList
class CollectionWrapper<T> {
var type: Class<T>
var list: MyList<T>
constructor(valueType: Class<T>, list: MyList<T>) {
View RandomCreditCardNumberGenerator.java
import java.util.List;
import java.util.Stack;
import java.util.Vector;
/**
* See the license below. Obviously, this is not a Javascript credit card number
* generator. However, The following class is a port of a Javascript credit card
* number generator.
*
* @author robweber
@gavelez
gavelez / RxJava.md
Created Aug 20, 2017 — forked from cesarferreira/RxJava.md
Party tricks with RxJava, RxAndroid & Retrolambda
View RxJava.md

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
You can’t perform that action at this time.