0

多くのアクティビティを持つ Android ベースのアプリケーションを作成しています。それらの間を移動したいのですが、このエラーが発生しています: cannot be resolved or is not a filed.

メインコードは次のとおりです。

    public void onButtonClicker(View v)
            {
                Intent intent;

                switch (v.getId()) {
                case R.id.hotels_bt:
                    intent = new Intent(this, hotels.class);
                    startActivity(intent);
                    break;

                case R.id.restaurants_bt:
                    intent = new Intent(this, restaurants.class);
                    startActivity(intent);
                    break;

                case R.id.airports_bt:
                    intent = new Intent(this, airports.class);
                    startActivity(intent);
                    break;

                case R.id.currency_bt:
                    intent = new Intent(this, currency.class);
                    startActivity(intent);
                    break;

                case R.id.praytime_bt:
                    intent = new Intent(this, prayTime.class);
                    startActivity(intent);
                    break;

                case R.id.about_bt:
                    intent = new Intent(this, about.class);
                    startActivity(intent);
                    break;  
                default:
                    break;
                }


 }

各クラス名でこのエラーが発生していますが、その原因はわかりません。

4

2 に答える 2

0

.java ファイルの名前 (クラス名) とその参照 (Activity.class) の両方が大文字で始まることを確認してください。

于 2013-11-04T22:05:02.737 に答える