Should you only mock types you own?

My answer is “no”. You should mock anything that makes sense in the context of a given unit test. It should not matter if you “own” the mocked type or not. These days, in a Java or .NET environment everything (and I really mean everything) can be easily mocked. So, there is no technical reason … Read more

Change the text color of NumberPicker

The solution I tried and worked for me is: In styles.xml add: <style name=”AppTheme.Picker” parent=”Theme.AppCompat.Light.NoActionBar” > <item name=”android:textColorPrimary”>@android:color/black</item> </style> Then use it like this inside your layout: <NumberPicker android:id=”@+id/dialogPicker” android:theme=”@style/AppTheme.Picker” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_marginTop=”15dp” />

Base64 images to gmail

The links from Moin Zaman show test results that are outdated (from 2008). As of my thorough testing today Gmail does support displaying embedded images for both methods. Use base64 encoding image inline within <img src=”https://stackoverflow.com/questions/3279523/…”> <html><body><img src=”data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9QAAADmCAIAAAC77FroAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAO…”></body></html> Use base64 encoded image as attachment Message-ID: <[email protected]> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [xxx.xxx.xxx.xxx] … Read more