且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在包中发现属性“showAsAction”无资源标识符'机器人'

更新时间:2022-10-23 16:12:30

你确定你正在寻找的* .xml文件吗?你似乎寻找在布局XMLSshowAsAction,但它的参数菜单。看起来相当变成... /菜单/ your_activity.xml

正在处理与利用的目标低于4.0和/或API小于14连接的问题。

因此​​,

一)修改这些参数,

b)由从不到ifRoom改变showAsAction的价值。

as the title suggest, I'm getting that error in at least 3 of the XML layout files, however, I dont see the attritube "showsAsAction" in any of those XML files, did I miss something or am I just blind?, here are the XML files in question:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <Button
        android:id="@+id/findSelected"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Registrar Asistencia" 
        android:onClick="registrarAsistencia"/>

     <ListView 
         android:id="@+id/listaAlumnos" 
         android:layout_width="fill_parent"
         android:layout_height="fill_parent" />

</LinearLayout>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center|top"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/lblCuenta"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Cuenta"
        android:textAppearance="?android:attr/textAppearanceLarge" />


    <EditText
        android:id="@+id/txtCuenta"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10" /> 

    <TextView
        android:id="@+id/lblPass"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Contraseña"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <EditText
        android:id="@+id/txtPass"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPassword" />

    <Button
        android:id="@+id/btnIniciarSesion"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="iniciarSesion"
        android:text="Iniciar Sesion" />

</LinearLayout>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >


    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:text="Large Text"
        android:textAppearance="?android:attr/textAppearanceLarge" />

</RelativeLayout>

Also, I'm using Android 2.2 (API 8) as the target version. I know "showAsAction" was implemented in API 11, but I just cant find the issue here.

Update: The problems panel shows the following errors:

Error generating final archive: java.io.FileNotFoundException: C:\Users\\Documents\Android\Registro de Asistencia\bin\resources.ap_ does not exist

Are you sure you are looking in the right *.xml file? You seem to look for "showAsAction" in layout xmls, but it's parameter for the menu. Look rather into .../menu/your_activity.xml

The problem you are dealing with is connected with using target less than 4.0 and/or API less than 14.

So,

a) change those parameters,

b) change the value of showAsAction from "never" to "ifRoom".