android - Getting "error can't convert to dimension type 0x12" -


i developing android launcher , getting error " can't convert dimension type 0x12" on phones. have read because of screen densities, cannot find noteworthy of error. here xml file:

<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" >  <linearlayout     android:id="@+id/home_view"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical" >      <linearlayout         android:layout_width="fill_parent"         android:layout_height="?android:attr/actionbarsize"         android:background="@color/super_black_trans"         android:gravity="center"         android:orientation="horizontal" >          <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" />          <framelayout             android:layout_width="wrap_content"             android:layout_height="fill_parent"             android:layout_alignparentright="true"             android:layout_gravity="right"             android:gravity="center" >              <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" />             <!-- android:background="@drawable/activity_settings" -->               <!-- android:onclick="onsettings" -->              <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" />         </framelayout>     </linearlayout>     <!-- can add header gridview -->      <scrollview         android:id="@+id/grid_scroll_view"         android:layout_width="fill_parent"         android:layout_height="fill_parent" >          <linearlayout             android:layout_width="fill_parent"             android:layout_height="fill_parent"             android:orientation="vertical" >              <!--  <relativelayout     android:layout_width="fill_parent"     android:layout_height="?android:attr/actionbarsize"     android:background="@color/super_black_trans"     android:orientation="horizontal"/>             -->              <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" />         </linearlayout>     </scrollview> </linearlayout>  <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" />  </android.support.v4.widget.drawerlayout> 

and here oncreate activity problem generates.

    @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 >= 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);  } 

finally, here m stacktrace:

    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 start activity componentinfo{com.codiaq.launcher.alpha/com.codiaq.launcher.alpha.mainlaunchscreen}: java.lang.unsupportedoperationexception: can't convert dimension: type=0x12 03-24 17:32:08.938: e/androidruntime(1265):     @ android.app.activitythread.performlaunchactivity(activitythread.java:2059) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.app.activitythread.handlelaunchactivity(activitythread.java:2084) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.app.activitythread.access$600(activitythread.java:130) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.app.activitythread$h.handlemessage(activitythread.java:1195) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.os.handler.dispatchmessage(handler.java:99) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.os.looper.loop(looper.java:137) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.app.activitythread.main(activitythread.java:4745) 03-24 17:32:08.938: e/androidruntime(1265):     @ java.lang.reflect.method.invokenative(native method) 03-24 17:32:08.938: e/androidruntime(1265):     @ java.lang.reflect.method.invoke(method.java:511) 03-24 17:32:08.938: e/androidruntime(1265):     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:786) 03-24 17:32:08.938: e/androidruntime(1265):     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:553) 03-24 17:32:08.938: e/androidruntime(1265):     @ dalvik.system.nativestart.main(native method) 03-24 17:32:08.938: e/androidruntime(1265): caused by: java.lang.unsupportedoperationexception: can't convert dimension: type=0x12 03-24 17:32:08.938: e/androidruntime(1265):     @ android.content.res.typedarray.getdimensionpixelsize(typedarray.java:463) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.view.viewgroup$marginlayoutparams.<init>(viewgroup.java:5612) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.widget.linearlayout$layoutparams.<init>(linearlayout.java:1809) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.widget.linearlayout.generatelayoutparams(linearlayout.java:1721) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.widget.linearlayout.generatelayoutparams(linearlayout.java:58) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.view.layoutinflater.rinflate(layoutinflater.java:748) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.view.layoutinflater.inflate(layoutinflater.java:489) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.view.layoutinflater.inflate(layoutinflater.java:396) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.view.layoutinflater.inflate(layoutinflater.java:352) 03-24 17:32:08.938: e/androidruntime(1265):     @ com.android.internal.policy.impl.phonewindow.generatelayout(phonewindow.java:2784) 03-24 17:32:08.938: e/androidruntime(1265):     @ com.android.internal.policy.impl.phonewindow.installdecor(phonewindow.java:2844) 03-24 17:32:08.938: e/androidruntime(1265):     @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:252) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.app.activity.setcontentview(activity.java:1867) 03-24 17:32:08.938: e/androidruntime(1265):     @ com.codiaq.launcher.alpha.mainlaunchscreen.oncreate(mainlaunchscreen.java:94) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.app.activity.performcreate(activity.java:5008) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1079) 03-24 17:32:08.938: e/androidruntime(1265):     @ android.app.activitythread.performlaunchactivity(activitythread.java:2023) 03-24 17:32:08.938: e/androidruntime(1265):     ... 11 more 

also here manifest.xml

 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.codiaq.launcher.alpha"     android:versioncode="9"     android:versionname="1.0.1" >      <uses-permission android:name="android.permission.internet" />     <uses-permission android:name="android.permission.access_network_state" />       <uses-sdk         android:minsdkversion="13"         android:targetsdkversion="19" />  [.....]  </manifest> 

try adding parent layout to:

<android.support.v4.widget.drawerlayout 

for example linearlayout:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     xmlns:android1="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent" >  <android.support.v4.widget.drawerlayout android:id="@+id/drawer" android:layout_width="match_parent" android:layout_height="match_parent" android:focusable="true" android:focusableintouchmode="true" android:orientation="vertical" >  ... ... ... 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -