I am getting layout inflater error while using android:textSize="?android:attr/textAppearanceLarge" in my xml -


my application crashing if using android:textsize="?android:attr/textappearancelarge" in xml . don't want give hard coded text size because have create create xml different screen sizes or have manage text size @ run time.

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical" >     <edittext         android:id="@+id/title"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:hint="@string/title"         android:textsize="?android:attr/textappearancelarge" />     <linearlayout         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:orientation="horizontal" >         <button             android:id="@+id/saveondialog"             android:layout_width="0dp"             android:layout_height="wrap_content"             android:layout_weight="0.5"             android:text="@string/save"             style="?android:attr/buttonbarbuttonstyle"             android:textsize="?android:attr/textappearancelarge" />         <button             android:id="@+id/cancelondialog"             android:layout_width="0dp"             android:layout_height="wrap_content"             android:layout_weight="0.5"             android:text="@string/cancel"             style="?android:attr/buttonbarbuttonstyle"             android:textsize="?android:attr/textappearancelarge" />     </linearlayout> </linearlayout> 

here log.e output -

06-26 11:46:27.439: e/androidruntime(1731):     @ android.view.layoutinflater.createview(layoutinflater.java:620) 06-26 11:46:27.439: e/androidruntime(1731):     @ com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:56) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.view.layoutinflater.oncreateview(layoutinflater.java:669) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:694) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.view.layoutinflater.rinflate(layoutinflater.java:755) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.view.layoutinflater.inflate(layoutinflater.java:492) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.view.layoutinflater.inflate(layoutinflater.java:397) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.view.layoutinflater.inflate(layoutinflater.java:353) 06-26 11:46:27.439: e/androidruntime(1731):     @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:271) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.app.dialog.setcontentview(dialog.java:479) 06-26 11:46:27.439: e/androidruntime(1731):     @ com.umob.alerts.savedialog.showsavedialog(savedialog.java:19) 06-26 11:46:27.439: e/androidruntime(1731):     @ com.umob.notepad.notepadscreen.onoptionsitemselected(notepadscreen.java:41) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.app.activity.onmenuitemselected(activity.java:2566) 06-26 11:46:27.439: e/androidruntime(1731):     @ com.android.internal.policy.impl.phonewindow.onmenuitemselected(phonewindow.java:990) 06-26 11:46:27.439: e/androidruntime(1731):     @ com.android.internal.view.menu.menubuilder.dispatchmenuitemselected(menubuilder.java:735) 06-26 11:46:27.439: e/androidruntime(1731):     @ com.android.internal.view.menu.menuitemimpl.invoke(menuitemimpl.java:152) 06-26 11:46:27.439: e/androidruntime(1731):     @ com.android.internal.view.menu.menubuilder.performitemaction(menubuilder.java:874) 06-26 11:46:27.439: e/androidruntime(1731):     @ com.android.internal.view.menu.menupopuphelper.onitemclick(menupopuphelper.java:156) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.widget.adapterview.performitemclick(adapterview.java:298) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.widget.abslistview.performitemclick(abslistview.java:1100) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.widget.abslistview$performclick.run(abslistview.java:2788) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.widget.abslistview$1.run(abslistview.java:3463) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.os.handler.handlecallback(handler.java:730) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.os.handler.dispatchmessage(handler.java:92) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.os.looper.loop(looper.java:137) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.app.activitythread.main(activitythread.java:5214) 06-26 11:46:27.439: e/androidruntime(1731):     @ java.lang.reflect.method.invokenative(native method) 06-26 11:46:27.439: e/androidruntime(1731):     @ java.lang.reflect.method.invoke(method.java:525) 06-26 11:46:27.439: e/androidruntime(1731):     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:739) 06-26 11:46:27.439: e/androidruntime(1731):     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:555) 06-26 11:46:27.439: e/androidruntime(1731):     @ dalvik.system.nativestart.main(native method) 06-26 11:46:27.439: e/androidruntime(1731): caused by: java.lang.reflect.invocationtargetexception 06-26 11:46:27.439: e/androidruntime(1731):     @ java.lang.reflect.constructor.constructnative(native method) 06-26 11:46:27.439: e/androidruntime(1731):     @ java.lang.reflect.constructor.newinstance(constructor.java:417) 06-26 11:46:27.439: e/androidruntime(1731):     @ android.view.layoutinflater.createview(layoutinflater.java:594) 

use android:textappearance="?android:attr/textappearancemedium"

instead of

android:textsize="?android:attr/textappearancemedium"


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -