2012-09-03 35 views
1

我在Eclipse(google-map Android)中有一個項目,它有三個Activity類。當我點擊運行時,我預計mainActivity會首先打開,但我不認爲這是開放的,因爲當該人在AVD中運行時,它會打開一個未在下面的類中定義的位置。我如何在Eclipse項目中指定啓動Activity?Android Java谷歌地圖如何判斷哪些活動在AVD中運行

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/[email protected]@._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/[email protected]@._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/[email protected]@._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/[email protected]@._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/[email protected]@._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/[email protected]@._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/[email protected]@._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/[email protected]@._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/[email protected]@._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/[email protected]@._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/[email protected]@._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); 

    }} 

回答

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> 
相關問題