This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static final Observable<Long> getExponentialBackoffSequence(@Nullable Long startValue, | |
@Nullable Long maxValue, | |
@Nullable Long multiplier, | |
@Nullable Long sequenceLength, | |
@Nullable Long maxValueRepeatCount) { | |
// set defaults if necessary | |
if (startValue == null) { | |
startValue = 1L; | |
} | |
final long start = startValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Rect; | |
import android.os.Handler; | |
import android.os.SystemClock; | |
import android.text.Editable; | |
import android.text.GetChars; | |
import android.text.NoCopySpan; | |
import android.text.Spannable; | |
import android.text.Spanned; | |
import android.text.TextUtils; | |
import android.text.TextWatcher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tell the media scanner about the new file so that it is | |
// immediately available to the user. | |
MediaScannerConnection.scanFile(context.getApplicationContext(), | |
new String[] { file.toString() }, null, (path, uri) -> { | |
Log.i("ExternalStorage", "Scanned " + path + ":"); | |
Log.i("ExternalStorage", "-> uri=" + uri); | |
// make the file visible in the downloads app | |
DownloadManager downloadManager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE); | |
downloadManager.addCompletedDownload(file.getName(), file.getName(), true, "application/gpx+xml", file.getAbsolutePath(), file.length(), true); | |
}); |