I'm trying to follow the steps of an example to create a horizontal menu, and the same code to me shows me an error.
This is the MainActivity code
package com.ejemplo.socu.menuhorizontal;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.HorizontalScrollView;
import android.widget.TextView;
import android.widget.Toast;
import com.darwindeveloper.horizontalscrollmenulibrary.custom_views.HorizontalScrollMenuView;
public class MainActivity extends AppCompatActivity {
HorizontalScrollMenuView menu;
TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
menu = (HorizontalScrollMenuView) findViewById(R.id.menu);
textView = (TextView)findViewById(R.id.txtText);
//Create menu
initMenu();
}
private void initMenu() {
menu.addItem("Transaction",R.drawable.ic_money);
menu.addItem("Payment",R.drawable.ic_payment);
menu.addItem("Account",R.drawable.ic_acc);
menu.addItem("Support",R.drawable.ic_done);
menu.setOnHSMenuClickListener(new HorizontalScrollMenuView.OnHSMenuClickListener(){
@Override
public void onHSMClick(MenuItem menuItem, int position) {
Toast.makeText(MainActivity.this, ""+menuItem.getText(), Toast.LENGTH_SHORT).show();
textView.setText(menuItem.getText());
}
});
}
}
And I am checking the following text with an error, and it is the same as in the example to create the menu: menu.setOnHSMenuClickListener (new HorizontalScrollMenuView.OnHSMenuClickListener () {