Created
December 5, 2012 13:44
Unit Testing and Threads 1
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 class TestStuff extends AndroidTestCase { | |
private final String TAG = "TestStuff"; | |
private final BroadcastReceiver receiver = new BroadcastReceiver() { | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
Log.d(TAG, "onReceive is running on thread: " + Thread.currentThread().getName()); | |
} | |
}; | |
public void testStuff() { | |
Context ctx = getContext(); | |
Log.d(TAG, "Test is running on thread: " + Thread.currentThread().getName()); | |
IntentFilter filter = new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION); | |
ctx.registerReceiver(receiver, filter); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment