1

3 つの Activity クラスを持つ Eclipse(google-map Android) のプロジェクトがあります。クリックして実行すると、mainActivity が最初に開くと予想されますが、男性が AVD で実行すると、以下のクラスで定義されていない場所が開くため、それが開くとは思いません。Eclipse プロジェクトで開始アクティビティを指定するにはどうすればよいですか?

public class LocalGeoPoints {

    public Vector<OverlayItem> overlayitems;

    public LocalGeoPoints()
    {
        overlayitems = new Vector<OverlayItem>();
        populate();
    }

    void populate()
    {
           GeoPoint point = new GeoPoint(19240000,-99120000);
            //OverlayItem overlayitem = new OverlayItem(point, "Hola, Mundo!", "I'm in Mexico City!");
            CustomOverlayItem overlayItem = new CustomOverlayItem(point, "Tomorrow Never Dies (1997)", 
                    "(M gives Bond his mission in Daimler car)", 
                    "http://ia.media-imdb.com/images/M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg");
          //try adding another one 
            GeoPoint point2 = new GeoPoint(419027880,  -876874637);
           // OverlayItem overlayitem2 = new OverlayItem(point2, "Sekai, konichiwa!", "I'm in Japan!");
           CustomOverlayItem overlayItem2 = new CustomOverlayItem(point2, "Tomorrow Never Dies (1997)", 
                    "(M gives Bond his mission in Daimler car)", 
                    "http://ia.media-imdb.com/images/M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg");
            //try adding another one 
            GeoPoint point3 = new GeoPoint( 419143417,  -876520184);
           // OverlayItem overlayitem3 = new OverlayItem(point3, "Chicago, WrigleyVile!", "I'm in Japan!");
           CustomOverlayItem overlayItem3 = new CustomOverlayItem(point3, "Tomorrow Never Dies (1997)", 
                    "(M gives Bond his mission in Daimler car)", 
                    "http://ia.media-imdb.com/images/M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg");
            //try adding another one 
            GeoPoint point4 = new GeoPoint(419054711, -87673388);
            //OverlayItem overlayitem4 = new OverlayItem(point4, "Chicago, BuckTown!", "I'm in Japan!");
           CustomOverlayItem overlayItem4 = new CustomOverlayItem(point4, "Tomorrow Never Dies (1997)", 
                    "(M gives Bond his mission in Daimler car)", 
                    "http://ia.media-imdb.com/images/M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg");
            //try adding another one 
            GeoPoint point5 = new GeoPoint( 419054431, -876697719);
            //OverlayItem overlayitem5 = new OverlayItem(point5, "Chicago, Ukrainian Village!", "I'm in Japan!");
           CustomOverlayItem overlayItem5 = new CustomOverlayItem(point5, "Tomorrow Never Dies (1997)", 
                    "(M gives Bond his mission in Daimler car)", 
                    "http://ia.media-imdb.com/images/M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg");
            //try adding another one 
            GeoPoint point6 = new GeoPoint(419095912, -876762629);
            //OverlayItem overlayitem6 = new OverlayItem(point6, "Chicago, Wicker Park!", "I'm in Japan!");
           CustomOverlayItem overlayItem6 = new CustomOverlayItem(point6, "Tomorrow Never Dies (1997)", 
                    "(M gives Bond his mission in Daimler car)", 
                    "http://ia.media-imdb.com/images/M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg");
            //try adding another one 
            GeoPoint point7 = new GeoPoint(419104535, -876774752);
           //OverlayItem overlayitem7 = new OverlayItem(point7, "Chicago, Damen & Milwaukee!", "I'm in Japan!");
           CustomOverlayItem overlayItem7 = new CustomOverlayItem(point7, "Tomorrow Never Dies (1997)", 
                    "(M gives Bond his mission in Daimler car)", 
                    "http://ia.media-imdb.com/images/M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg");
            //try adding another one 
            GeoPoint point8 = new GeoPoint(419118028, -876642466);
            //OverlayItem overlayitem8 = new OverlayItem(point8, "Chicago, Division!", "I'm in Japan!");
           CustomOverlayItem overlayItem8 = new CustomOverlayItem(point8, "Tomorrow Never Dies (1997)", 
                    "(M gives Bond his mission in Daimler car)", 
                    "http://ia.media-imdb.com/images/M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg");
            //try adding another one 
            GeoPoint point9 = new GeoPoint(419143617,  -876532656);
           // OverlayItem overlayitem9 = new OverlayItem(point9, "Chicago, Humboldt Park!", "I'm in Japan!");
           CustomOverlayItem overlayItem9 = new CustomOverlayItem(point9, "Tomorrow Never Dies (1997)", 
                    "(M gives Bond his mission in Daimler car)", 
                    "http://ia.media-imdb.com/images/M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg");
            //try adding another one 
            GeoPoint point10 = new GeoPoint(419141102,  -876567471);
            //OverlayItem overlayitem10 = new OverlayItem(point10, "Chicago, Ashland!", "I'm in Japan!");
           CustomOverlayItem overlayItem10 = new CustomOverlayItem(point10, "Tomorrow Never Dies (1997)", 
                    "(M gives Bond his mission in Daimler car)", 
                    "http://ia.media-imdb.com/images/M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg");
            //try adding another one 
            GeoPoint point11= new GeoPoint(419032033, -876770782);
            //OverlayItem overlayitem11 = new OverlayItem(point11, "Chicago, Levitt!", "I'm in Japan!");
           CustomOverlayItem overlayItem11 = new CustomOverlayItem(point11, "Tomorrow Never Dies (1997)", 
                    "(M gives Bond his mission in Daimler car)", 
                    "http://ia.media-imdb.com/images/M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg");

            overlayitems.add(overlayItem);
            overlayitems.add(overlayItem2);
            overlayitems.add(overlayItem3);
            overlayitems.add(overlayItem4);
            overlayitems.add(overlayItem5);
            overlayitems.add(overlayItem6);
            overlayitems.add(overlayItem7);
            overlayitems.add(overlayItem8);
            overlayitems.add(overlayItem9);
            overlayitems.add(overlayItem10);
            overlayitems.add(overlayItem11);

    }}
4

1 に答える 1

0

アプリケーションの起動時に最初に開始するアクティビティを指定するには、プロジェクトの AndroidManifest.xml ファイルでインテント フィルターを定義します。これが例です

<activity
        android:label="MainActivity"
        android:name="yourprojectname.thenameoftheclass" >
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
</activity>
于 2012-09-03T19:42:54.537 に答える