Following is a little dirty, but worked on Nexus 5 (Android 4.4.2):
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="MainActivity"
android:label="@string/app_name"
android:configChanges="fontScale" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
MainActivity.java
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Make sure to do this before setContentView()
Configuration currentConfig = getResources().getConfiguration();
if (currentConfig.fontScale < 1.0f) {
currentConfig.fontScale = 1.0f;
getResources().updateConfiguration(currentConfig, null);
}
setContentView(R.layout.activity_main);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (newConfig.fontScale < 1.0f) {
newConfig.fontScale = 1.0f;
}
getResources().updateConfiguration(newConfig, null);
// Restart to apply the new changes
AlarmManager am = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP,
Calendar.getInstance().getTimeInMillis() + 1000, // one second
PendingIntent.getActivity(this, 0, getIntent(), PendingIntent.FLAG_ONE_SHOT
| PendingIntent.FLAG_CANCEL_CURRENT));
finish();
}
}
Hope this helps.
Please let me know if there is any need for explanation of the above.