读书人

android Menu设定后点击无反应也无异

发布时间: 2013-08-06 16:47:25 作者: rapoo

android Menu设定后,点击无反应也无错误提示,求解


android:layout_marginBottom="10dp"/>
<TextView android:text="Notes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp" />
<EditText android:id="@+id/notes_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:layout_weight="1"
android:layout_marginBottom="10dp"/>

<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="#FF8D8D8D"
android:gravity="center_horizontal">

<Button android:text="Save"
android:onClick="onSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button android:text="Cancel"
android:onClick="onCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>


</LinearLayout>

</LinearLayout>




android:title="@string/action_settings"/>


</menu>



<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.tracker"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.tracker.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name="com.example.tracker.AddTimeActivity"></activity>
</application>



</manifest>



Logcat提示两个Warning~~
08-04 18:25:53.727: W/ResourceType(1266): No package identifier when getting value for resource number 0x00000000
08-04 18:25:53.727: W/PackageManager(1266): Failure retrieving resources forcom.example.tracker: Resource ID #0x0


[解决办法]
onMenuItemSeletced 没进去么,打个断点看看.
前面加上@Override试试.

读书人网 >Android

热点推荐