title: Getting "error can't convert to dimension type 0x12"
body: <p>I am developing an android launcher and I am getting the error " can't convert to dimension type 0x12" on some phones. I have read that this could be because of screen densities, but I cannot find anything noteworthy of error. 
  Here is my xml file:</p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/drawer"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:focusable="true"
  android:focusableInTouchMode="true"
  android:orientation="vertical" &gt;
  
  &lt;LinearLayout
      android:id="@+id/home_view"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="?android:attr/actionBarSize"
          android:background="@color/Super_Black_Trans"
          android:gravity="center"
          android:orientation="horizontal" &gt;
  
          &lt;AutoCompleteTextView
              android:id="@+id/home_search"
              android:layout_width="fill_parent"
              android:layout_height="?android:attr/actionBarSize"
              android:layout_weight="1"
              android:background="#00000000"
              android:dropDownVerticalOffset="0dp"
              android:gravity="center|left"
              android:hint="@string/search_for"
              android:maxLines="1"
              android:paddingLeft="20dp"
              android:popupBackground="@color/Super_Black_Trans"
              android:textColor="#C0C0C0"
              android:textSize="25sp" /&gt;
  
          &lt;FrameLayout
              android:layout_width="wrap_content"
              android:layout_height="fill_parent"
              android:layout_alignParentRight="true"
              android:layout_gravity="right"
              android:gravity="center" &gt;
  
              &lt;ImageButton
                  android:id="@+id/settings_button"
                  android:layout_width="25dp"
                  android:layout_height="25dp"
                  android:layout_alignParentRight="true"
                  android:layout_margin="10dp"
                  android:layout_weight="1"
                  android:background="@drawable/activity_settings"
                  android:gravity="center"
                  android:onClick="onSettings" /&gt;
              &lt;!-- android:background="@drawable/activity_settings" --&gt;
  
  
              &lt;!-- android:onClick="onSettings" --&gt;
  
              &lt;ImageButton
                  android:id="@+id/search_button"
                  android:layout_width="25dp"
                  android:layout_height="25dp"
                  android:layout_alignParentRight="true"
                  android:layout_margin="10dp"
                  android:layout_weight="1"
                  android:background="@drawable/ic_action_search"
                  android:gravity="center"
                  android:onClick="onSearch" /&gt;
          &lt;/FrameLayout&gt;
      &lt;/LinearLayout&gt;
      &lt;!-- So That I can add header to GridView easily --&gt;
  
      &lt;ScrollView
          android:id="@+id/grid_scroll_view"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" &gt;
  
          &lt;LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:orientation="vertical" &gt;
  
              &lt;!--
   &lt;RelativeLayout
      android:layout_width="fill_parent"
      android:layout_height="?android:attr/actionBarSize"
      android:background="@color/Super_Black_Trans"
      android:orientation="horizontal"/&gt;
              --&gt;
  
              &lt;com.codiaq.launcher.alpha.ExpandableHeightGridView
                  android:id="@+id/home_content"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:numColumns="4"
                  android:padding="5dp"
                  android:scrollbars="none" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
  &lt;/LinearLayout&gt;
  
  &lt;GridView
      android:id="@+id/left_drawer"
      android:layout_width="85dp"
      android:layout_height="fill_parent"
      android:layout_gravity="start"
      android:background="@color/Mega_Black_Trans"
      android:choiceMode="singleChoice"
      android:footerDividersEnabled="true"
      android:gravity="center"
      android:numColumns="1"
      android:padding="5dp" /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>and here is my onCreate activity where the problem generates.</p>
  
  <pre><code>    @SuppressWarnings("deprecation")
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  sh = new SettingsHandler(this);
  super.onCreate(savedInstanceState);
  final int[] ITEM_DRAWABLES = { R.drawable.ic_action_settings, R.drawable.ic_icon_device_settings, R.drawable.ic_icon_google_play};
      setContentView(R.layout.activity_main_launch_screen);
      drawer = (GridView)findViewById(R.id.left_drawer);
      mDrawer = (android.support.v4.widget.DrawerLayout)findViewById(R.id.drawer);
      ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams) drawer
              .getLayoutParams();
      sidebarItems = new FunctionsM[]{
              new FunctionsM(getString(R.string.phone)),
              new FunctionsM(getString(R.string.contacts)),
              new FunctionsM(getString(R.string.texts)),
              new FunctionsM(getString(R.string.music)),
              new FunctionsM(getString(R.string.email)),
              new FunctionsM(getString(R.string.browser))
  
      };
      searchButton = (ImageButton)findViewById(R.id.search_button);
      settingsButton = (ImageButton)findViewById(R.id.settings_button);
      searchButton.setVisibility(View.GONE);
      homeView = (LinearLayout)findViewById(R.id.home_view);
      home_grid = (ExpandableHeightGridView)findViewById(R.id.home_content);
      home_grid.setExpanded(true);
      home_view_search = (AutoCompleteTextView)findViewById(R.id.home_search);
      mDrawer.setScrimColor(getResources().getColor(android.R.color.transparent));
      GridScrollView = (ScrollView)findViewById(R.id.grid_scroll_view);
      cmd = new PubCommands(this, MainLaunchScreen.this);
      home_grid.setPadding(0, 0, 0, cmd.getNavHeight());
      if (Build.VERSION.SDK_INT &gt;= 19){
          statbar_height = cmd.calcStatBar();
          homeView.setPadding(0, statbar_height,0,0);
          }
      int actionBarHeight = 0;
      TypedValue tv = new TypedValue();
      if (getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))
      {
          actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics());
      }
      int value = statbar_height + actionBarHeight;
      mlp.setMargins(0, value, 0, - value);
      drawer.setLayoutParams(mlp);
      //drawer.setPadding(0, statbar_height + actionBarHeight, 0, 0);
  
  }
  </code></pre>
  
  <p>Finally, here is m stacktrace:</p>
  
  <pre><code>    03-24 17:32:08.938: E/AndroidRuntime(1265): FATAL EXCEPTION: main
  03-24 17:32:08.938: E/AndroidRuntime(1265): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.codiaq.launcher.alpha/com.codiaq.launcher.alpha.MainLaunchScreen}: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x12
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.os.Handler.dispatchMessage(Handler.java:99)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.os.Looper.loop(Looper.java:137)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.app.ActivityThread.main(ActivityThread.java:4745)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at java.lang.reflect.Method.invokeNative(Native Method)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at java.lang.reflect.Method.invoke(Method.java:511)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at dalvik.system.NativeStart.main(Native Method)
  03-24 17:32:08.938: E/AndroidRuntime(1265): Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x12
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.view.ViewGroup$MarginLayoutParams.&lt;init&gt;(ViewGroup.java:5612)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.widget.LinearLayout$LayoutParams.&lt;init&gt;(LinearLayout.java:1809)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1721)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:58)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:748)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2784)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2844)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:252)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.app.Activity.setContentView(Activity.java:1867)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at com.codiaq.launcher.alpha.MainLaunchScreen.onCreate(MainLaunchScreen.java:94)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.app.Activity.performCreate(Activity.java:5008)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
  03-24 17:32:08.938: E/AndroidRuntime(1265):     ... 11 more
  </code></pre>
  
  <p>also here is my manifest.xml</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.codiaq.launcher.alpha"
      android:versionCode="9"
      android:versionName="1.0.1" &gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  
  
      &lt;uses-sdk
          android:minSdkVersion="13"
          android:targetSdkVersion="19" /&gt;
  
  [.....]
  
  &lt;/manifest&gt;
  </code></pre>