Custom Fonts and Custom Textview on Android

The constructor of TextView calls setTypeface(Typeface tf, int style) with the style parameter retrieved from the XML attribute android:textStyle. So, if you want to intercept this call to force your own typeface you can override this method as follow: public void setTypeface(Typeface tf, int style) { Typeface normalTypeface = Typeface.createFromAsset(getContext().getAssets(), “font/your_normal_font.ttf”); Typeface boldTypeface = Typeface.createFromAsset(getContext().getAssets(), … Read more

Android: Refreshing the Gallery after saving new images

Code provided by Petrus in another answer works for me on Kitkat (4.4): MediaScannerConnection.scanFile(this, new String[] { Environment.getExternalStorageDirectory().toString() }, null, new MediaScannerConnection.OnScanCompletedListener() { /* * (non-Javadoc) * @see android.media.MediaScannerConnection.OnScanCompletedListener#onScanCompleted(java.lang.String, android.net.Uri) */ public void onScanCompleted(String path, Uri uri) { Log.i(“ExternalStorage”, “Scanned ” + path + “:”); Log.i(“ExternalStorage”, “-> uri=” + uri); } });