Skip to content

Instantly share code, notes, and snippets.

View aniXification's full-sized avatar

Anish Shrestha aniXification

View GitHub Profile
/*
* Copyright 2014 Google Inc.
*
* 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
/**
* Copyright 2013 Alex Yanchenko
*
* 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
@aniXification
aniXification / NetworkChangeReceiver
Created June 30, 2013 18:12
Check internet connection change via Broadcast Receiver in background. #android
public class NetworkChangeReceiver extends BroadcastReceiver{
private static final String LOG_TAG = "NetworkChangeReceiver";
private boolean isConnected = false;
@Override
public void onReceive(Context context, Intent intent) {
Log.v(LOG_TAG, "Receieved notification about network status");
isNetworkAvailable(context);
}
package com.marcingil.dragshadow;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.View;