title: Loading - custom font in widget
body: <p>I have a problem with custom font in widget. I tried method from this <a href="https://stackoverflow.com/questions/2376250/custom-fonts-and-xml-layouts-android">question</a>.
  I put font file (Moon.ttf) in assets/fonts. Add an xml in values/attrs. And when I add my widget to homescreen it shows loading problem. In logcat shows these. And I don't why it doesn't work.</p>
  
  <pre><code>    09-10 19:26:14.914: W/AppWidgetHostView(2535): updateAppWidget couldn't find any view, using error view
  09-10 19:26:14.914: W/AppWidgetHostView(2535): android.view.InflateException: Binary XML file line #40: Error inflating class com.pxr.tutorials.widget.basic.FontableTextView
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.widget.RemoteViews.apply(RemoteViews.java:930)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.appwidget.AppWidgetHostView.updateAppWidget(AppWidgetHostView.java:219)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.appwidget.AppWidgetHost.updateAppWidgetView(AppWidgetHost.java:250)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.appwidget.AppWidgetHost$UpdateHandler.handleMessage(AppWidgetHost.java:73)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.os.Handler.dispatchMessage(Handler.java:99)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.os.Looper.loop(Looper.java:123)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.app.ActivityThread.main(ActivityThread.java:4641)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at java.lang.reflect.Method.invokeNative(Native Method)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at java.lang.reflect.Method.invoke(Method.java:521)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:638)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at dalvik.system.NativeStart.main(Native Method)
  09-10 19:26:14.914: W/AppWidgetHostView(2535): Caused by: java.lang.ClassNotFoundException: com.pxr.tutorials.widget.basic.FontableTextView in loader dalvik.system.PathClassLoader[.]
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.view.LayoutInflater.createView(LayoutInflater.java:466)
  09-10 19:26:14.914: W/AppWidgetHostView(2535):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
  </code></pre>
  
  <p>Here is FontableTextView class:</p>
  
  <pre><code>public class FontableTextView extends TextView {
      public static final String TAG = "TextView";
      public FontableTextView(Context context) {
          super(context);
      }
  
      public FontableTextView(Context context, AttributeSet attrs) {
          super(context, attrs);
         setCustomFont(context,attrs);
  
      }
  
      public FontableTextView(Context context, AttributeSet attrs, int defStyle) {
          super(context, attrs, defStyle);
          setCustomFont(context,attrs);
      }
  
      private void setCustomFont(Context ctx, AttributeSet attrs) {
          TypedArray a = ctx.obtainStyledAttributes(attrs, R.styleable.FontableTextView);
          String customFont = a.getString(R.styleable.FontableTextView_font);
          setCustomFont(ctx, customFont);
          a.recycle();    
      }
  
      public boolean setCustomFont(Context ctx, String asset){
          Typeface tf= null;
          try{
              tf = Typeface.createFromAsset(ctx.getAssets(), asset);
          }catch (Exception e){
              Log.e(TAG , "Could not get typeface: "+e.getMessage());
  
              return false;
          }
          setTypeface(tf);
          return false;
      }
  }
  </code></pre>
  
  <p>attrs.xml</p>
  
  <pre><code>&lt;resources&gt;
         &lt;declare-styleable name="FontableTextView"&gt;
          &lt;attr name="font" format="string"/&gt;
      &lt;/declare-styleable&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>And widget layout:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:foo="http://schemas.android.com/apk/res/com.pxr.tutorials.widget.basic"
      android:id="@+id/LinearLayout01"
      android:layout_height="200dp"
      android:layout_width="320dp"
          &gt;
  
  &lt;ImageView
      android:id="@+id/imageView1"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_centerInParent="true"
      android:src="@drawable/quote1" /&gt;
  
    &lt;LinearLayout 
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:paddingLeft="20dp"
      android:paddingRight="20dp"
  
  
        &gt; 
  
  &lt;TextView  
       android:paddingTop="20dp"
      android:id="@+id/widget_textview"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content" 
      android:gravity="center_vertical|center_horizontal"
      android:textColor="@android:color/black"
      android:text="@string/quote"
      android:textSize="7pt"
      android:layout_weight="2"
      android:textStyle="italic"
      android:ellipsize="end"
  
      /&gt;
  &lt;com.pxr.tutorials.widget.basic.FontableTextView
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:textSize="5pt"
     android:text="@string/app_name"
     android:textColor="@android:color/black"
     foo:font="Moon.ttf"
      &gt;&lt;/com.pxr.tutorials.widget.basic.FontableTextView&gt;
  
  &lt;TextView  
      android:id="@+id/widget_textview_author"
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:gravity="bottom|left"
      android:textColor="@android:color/black"
      android:text="@string/author"
      android:textSize="5pt"
      android:paddingLeft="0dp"
      android:paddingBottom="25dp"
      android:layout_weight="1"
  
      /&gt;
  &lt;/LinearLayout&gt;
    &lt;/RelativeLayout&gt;  
  </code></pre>