java - ActionBar implementation throws an exception -
i implementing actionbar android. having difficulties java code. when run app eclipse throws me error in code:
package com.example.android.rssfeed; import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.menu; import android.view.menuitem; public class rssfeedactivity extends activity implements mylistfragment.onitemselectedlistener { // place shows me error @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_rssfeed); } //new @override public boolean oncreateoptionsmenu(menu menu) { menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.mainmenu, menu); return true; } //new @override public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { case r.id.action_refresh: toast.maketext(this, "action refresh selected", toast.length_short) .show(); break; case r.id.action_settings: toast.maketext(this, "action settings selected", toast.length_short) .show(); break; default: break; } return true; } }
i left comment error is.
your activity needs override methods in of mylistfragment.onitemselectedlistener
interface, otherwise shows compiler error.
Comments
Post a Comment