Hi I am developing an Android application. In my application I am using Sherlock action. I\'ve defined few menu items in action-bar like in following manner
<
Full working code
Code:
@Override
public boolean onCreateOptionsMenu(final Menu menu) {
getMenuInflater().inflate(R.menu.menu,menu); MenuItem item = menu.findItem(R.id.mSearch);
ImageView iv= (ImageView) item.getActionView().findViewById(R.id.search_1);
iv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(context, "clicked", Toast.LENGTH_SHORT).show();
}
});
return true;
}