title: android.view.InflateException: Binary XML file line #6: Error inflating class <unknown> while initializing progress bar
body: <p>This problem is not occurs every time its random.
  and mostly getting on nexus 7. </p>
  
  <p>I searched for it, but nothing helps me yet.
  Please me out.    </p>
  
  <pre><code>03-15 15:27:56.839: E/AndroidRuntime(22187): FATAL EXCEPTION: main
  03-15 15:27:56.839: E/AndroidRuntime(22187): Process: com.tmwtg, PID: 22187
  03-15 15:27:56.839: E/AndroidRuntime(22187): android.view.InflateException: Binary XML file line #6: Error inflating class &lt;unknown&gt;
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.view.LayoutInflater.createView(LayoutInflater.java:620)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.app.Dialog.setContentView(Dialog.java:477)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at com.tmwtg.common.CustomLoader.&lt;init&gt;(CustomLoader.java:18)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at com.tmwtg.profile.ProfilePage.onCreateView(ProfilePage.java:191)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.app.Fragment.performCreateView(Fragment.java:1700)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.app.BackStackRecord.run(BackStackRecord.java:684)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.app.FragmentManagerImpl$1.run(FragmentManager.java:443)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.os.Handler.handleCallback(Handler.java:733)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.os.Handler.dispatchMessage(Handler.java:95)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.os.Looper.loop(Looper.java:136)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.app.ActivityThread.main(ActivityThread.java:5017)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at java.lang.reflect.Method.invokeNative(Native Method)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at java.lang.reflect.Method.invoke(Method.java:515)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at dalvik.system.NativeStart.main(Native Method)
  03-15 15:27:56.839: E/AndroidRuntime(22187): Caused by: java.lang.reflect.InvocationTargetException
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at java.lang.reflect.Constructor.constructNative(Native Method)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.view.LayoutInflater.createView(LayoutInflater.java:594)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    ... 26 more
  03-15 15:27:56.839: E/AndroidRuntime(22187): Caused by: java.lang.OutOfMemoryError
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:587)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:422)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:840)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.content.res.Resources.loadDrawable(Resources.java:2110)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.content.res.Resources.getDrawable(Resources.java:700)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.graphics.drawable.AnimationDrawable.inflate(AnimationDrawable.java:282)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:937)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.content.res.Resources.loadDrawable(Resources.java:2092)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.widget.ProgressBar.&lt;init&gt;(ProgressBar.java:294)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.widget.ProgressBar.&lt;init&gt;(ProgressBar.java:246)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    at android.widget.ProgressBar.&lt;init&gt;(ProgressBar.java:242)
  03-15 15:27:56.839: E/AndroidRuntime(22187):    ... 29 more
  </code></pre>
  
  <p>This is my CustomLoader class:</p>
  
  <pre><code>public class CustomLoader extends Dialog {
  
  public CustomLoader(Context context) {
      super(context);
      // TODO Auto-generated constructor stub
  }
  
  public CustomLoader(Context context, int theme) {
      super(context, theme);
      // TODO Auto-generated constructor stub
      setContentView(R.layout.custom_progress_view);
  }
  
  public CustomLoader(Context context, boolean cancelable,
          OnCancelListener cancelListener) {
      super(context, cancelable, cancelListener);
      // TODO Auto-generated constructor stub
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and i'm getting error on this line : </p>
  
  <p>CustomLoader p;</p>
  
  <pre><code>p = new CustomLoader(getActivity(),
              android.R.style.Theme_Translucent_NoTitleBar);
  </code></pre>
  
  <p>and this is my XML class : </p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="@color/black_trans" &gt;
  
  &lt;ProgressBar
      android:id="@+id/progress"
      android:layout_width="130dp"
      android:layout_height="130dp"
      android:layout_centerInParent="true"
      android:layout_gravity="center"
      android:indeterminateDrawable="@drawable/anim_progress" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>i don't think its a memory problem, because when i add this.</p>
  
  <pre><code>@Override
  public void onLowMemory() {
      Toast.makeText(getActivity(), "its a low memory sign.....",
              Toast.LENGTH_SHORT).show();
  }
  </code></pre>
  
  <p>the toast is not displaying before crash.</p>