为什么会出现此错误? “错误:找不到符号类事件”

时间:2019-05-22 21:46:40

标签: android

sinal = np.frombuffer(stream.read(CHUNK, exception_on_overflow=False), np.int16) sinal[::2] #from channel 1 for exemple sinal[1::2] #from channel 2 for exemple

无法识别事件类。如何使用上述语法创建事件类?

Event ev1 = new Event (Color.RED, 1558549857000L,"wedding day");
public class MainActivity extends AppCompatActivity {
    CompactCalendarView compactCalendarView;
    private SimpleDateFormat dateFormat = new SimpleDateFormat("MMM- yyyy",Locale.getDefault());

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final ActionBar actionBar = getSupportActionBar();
        actionBar.setDisplayHomeAsUpEnabled(false);
        actionBar.setTitle(null);

        CompactCalendarView compactCalendar = (CompactCalendarView) findViewById(R.id.compactcalendar_view);
        compactCalendar.setUseThreeLetterAbbreviation(true);

        //set an event for teachers' professional Day 2019 which is 23st may

        Event ev1 = new Event(Color.RED, 1558549857000L,"Teachers professional Day");
        compactCalendar.addEvent(ev1);

        compactCalendar.setListener(new CompactCalendarView.CompactCalendarViewListener() {
            @Override
            public void onDayClick(Date dateClicked) {
                Context context = getApplicationContext();


                if (dateClicked.toString().compareTo("Thu may 23 09:00:00 AST 2016")==0){
                    Toast.makeText(context,"Teachers professional Day", Toast.LENGTH_SHORT).show();
                }else{
                    Toast.makeText(context,"No events for taht Day", Toast.LENGTH_SHORT).show();
                }

            }

            @Override
            public void onMonthScroll(Date firstDayOfNewMonth) {
               // actionBar.setTitle(dateFormatMonth.Format(firstDayOfNewMonth));
            }
        });

    }
}

  Event ev1 = new Event(Color.RED, 1558549857000L,"Teachers professional Day");
        compactCalendar.addEvent(ev1);

        compactCalendar.setListener(new CompactCalendarView.CompactCalendarViewListener() {
            @Override
            public void onDayClick(Date dateClicked) {
                Context context = getApplicationContext();


                if (dateClicked.toString().compareTo("Thu may 23 09:00:00 AST 2016")==0){
                    Toast.makeText(context,"Teachers professional Day", Toast.LENGTH_SHORT).show();
                }else{
                    Toast.makeText(context,"No events for taht Day", Toast.LENGTH_SHORT).show();
                }

            }

            @Override
            public void onMonthScroll(Date firstDayOfNewMonth) {
                actionBar.setTitle(dateFormatMonth.Format(firstDayOfNewMonth));
            }
        });

    }
}

0 个答案:

没有答案