Dies ist der manifest Code um das Thema:im Manifest
<activity
android:name="smartHomes.capstone.GeneralAndSecurity"
android:label="@string/title_activity_general_and_security"
android:parentActivityName="smartHomes.capstone.HomePage" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="smartHomes.capstone.HomePage" />
</activity>
Dies ist das Fehlerprotokoll:
03-20 21:19:18.227: E/AndroidRuntime(787): FATAL EXCEPTION: main
03-20 21:19:18.227: E/AndroidRuntime(787): java.lang.IllegalArgumentException: Activity GeneralAndSecurity does not have a parent activity name specified. (Did you forget to add the android.support.PARENT_ACTIVITY <meta-data> element in your manifest?)
03-20 21:19:18.227: E/AndroidRuntime(787): at android.support.v4.app.NavUtils.navigateUpFromSameTask(NavUtils.java:177)
03-20 21:19:18.227: E/AndroidRuntime(787): at smartHomes.capstone.GeneralAndSecurity.onOptionsItemSelected(GeneralAndSecurity.java:41)
03-20 21:19:18.227: E/AndroidRuntime(787): at com.actionbarsherlock.app.SherlockActivity.onMenuItemSelected(SherlockActivity.java:208)
Bitte kann ich wissen, warum Ist der Return-Up-Button ein Fehler?
können Sie Ihren Code schreiben um Zeile 41 deiner 'GeneralAndSecurity' Klasse? Das Protokoll sagt, es stürzt dort ab. Überprüfen Sie auch [die Post] (http://stackoverflow.com/questions/12276027/how-can-i-return-to-parent-activity-correctly) Frage/Antworten und sehen, ob sie helfen. – Mxyk