i want to add a search menu to my SherlockFragmentActivity, this is my code :
public class Home extends SherlockFragmentActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.home_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.home_search:
Intent i = new Intent(getApplicationContext(), SearchActivity.class);
startActivity(i);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
and this is my menu xml code :
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/home_search"
android:icon="@drawable/home_search"
android:orderInCategory="100"
android:showAsAction="always"/>
</menu>
when i run my app, i'm getting an exception : classnotfoundexception didn't find class "com.actionbarsherelock.R$styleable on path dexpathlist. What's the matter ?