2016-03-22 29 views
0

Tutulma projemi Android Studio'ya aktardım ve com.google.android.gms.common.api.GoogleApiClient olarak güncellendi.Harita Sorununu Eclipse projesini Studio'ya Aktarırken

Projemin birçok parça içeren bir ana etkinliği vardır. Ana düğme parçasının içinde Harita var. harita ekleyerek için aşağıya bakınız: başarıyla projeyi çalışan üzerinde

private void addMap() { 
FragmentManager fm = getChildFragmentManager(); 
if(isGoogleMapsInstalled()) 
    { 
     if (fragment == null) 
     { 
      GoogleMapOptions op = new GoogleMapOptions(); 
      op.zOrderOnTop(true); 
      op.zoomControlsEnabled(false); 
      fragment = MapFragment.newInstance(op); 
      fm.beginTransaction().replace(R.id.homemap_id, fragment).commit(); 
     } 
    }else 
    { 
     Toast.makeText(getActivity(), "Please install google map", Toast.LENGTH_SHORT).show(); 
    } 
} 

, koyduğu tüm görüş ve düğmeleri gizleme haritası. MainActivity'nin Menü Slider'ı bile aşağıdaki haritayı gösterir, ancak harita üzerinde çalışır ve harita devre dışı kalır.

enter image description here

** Düzenleme :: o kadar uygulama gradle kod aşağıda kullanılan bazı hafıza sorunu becoz olabilir düşündüm, ama hayır şans.

multiDexEnabled true 
dexOptions { 
incremental true 
javaMaxHeapSize "4g" 

}

Bu sorunu çözmek için yardım edin. ** Not :: kod Eclipse'de iyi çalıştı.

düzenlemek :: Eğer sorun için

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:custom="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/bg_texture_a" 
    android:orientation="vertical" > 

    <RelativeLayout android:id="@+id/map_container" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="1" > 

     <FrameLayout 
      android:id="@+id/homemap_id" 
      android:background="@color/dark_red_text_trans" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" > 
     </FrameLayout> 

     <CheckBox 
      android:id="@+id/traffic_heat_btn" 
      android:layout_width="42dp" 
      android:layout_height="42dp" 
      android:layout_alignParentRight="true" 
      android:layout_marginRight="10dp" 
      android:layout_marginTop="70dp" 
      android:background="@drawable/selector_traffic_toggle" 
      android:button="@null" 
      android:checked="false" 
      android:scaleType="fitCenter" /> 

     <TextView 
      android:id="@+id/mylocation_btn" 
      android:layout_width="42dp" 
      android:layout_height="42dp" 
      android:layout_alignParentRight="true" 
      android:layout_alignParentBottom="true" 
      android:layout_marginRight="10dp" 
      android:layout_marginBottom="70dp" 
      android:background="@drawable/selector_location_toggle" 
      android:button="@null" 
      android:scaleType="fitCenter" /> 

     <HorizontalScrollView 
      android:id="@+id/box_horizonScroll" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_margin="0dp" 
      android:orientation="horizontal" 
      android:scrollbars="vertical" 
      android:visibility="gone" > 

      <!-- android:background="#aaffffff" --> 

      <LinearLayout 
       android:id="@+id/dependent_layout" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:orientation="horizontal" 
       android:paddingLeft="5dp" 
       android:paddingRight="5dp" > 
      </LinearLayout> 

     </HorizontalScrollView> 


    </RelativeLayout> 

    <LinearLayout 
     android:id="@+id/mask_bottom_layout" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="0" 
     android:background="@color/dark_red_text" 
     android:gravity="center_vertical" 
     android:orientation="horizontal" 
     android:visibility="gone" > 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_weight="0" 
      android:paddingBottom="17dp" 
      android:paddingLeft="20dp" 
      android:paddingTop="17dp" 
      android:text="Cancel" 
      android:textColor="@color/white" 
      android:textSize="@dimen/text_sizes_smallest" 
      android:textStyle="bold" /> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_weight="1" 
      android:gravity="center" 
      android:text="DONE" 
      android:textColor="@color/white" 
      android:textSize="@dimen/text_sizes_medium" 
      android:textStyle="bold" /> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_weight="0" 
      android:paddingRight="15dp" 
      android:text="Clear Filters" 
      android:textColor="@color/white" 
      android:textSize="@dimen/text_sizes_smallest" 
      android:textStyle="bold" 
      android:visibility="visible" /> 
    </LinearLayout> 

</LinearLayout> 
+0

Düzen xml dosyalarını gönderebilir misiniz? – Raghavendra

+0

xml düzeninizde bir sorun var gibi görünüyor. Lütfen sorunla ilgili daha fazla bilgi için xml dosyanızı buraya gönderin. –

+0

@Raghavendra xml düzenini de ekledim. lütfen ona bakın ve herhangi bir yardım minnettar olacaktır. – Deepak

cevap

1

find out Here çözüm. ICS 4.0.4'te de aynı problem var. Jfeinstein10'un github postunda belirtilen çözümler benim için çalışmıyor gibi görünüyor. Ama bir çözüm buldum, en iyisi bile değil. DrawerToggle nesne oluştururken

Ben bu olay setScrimColor gölge kurtulmak olurken çekmece render sorunun üstesinden gerektiğini

@Override 
public void onDrawerSlide(View drawerView, float slideOffset) 
{ 
    super.onDrawerSlide(drawerView, slideOffset); 
    mDrawerLayout.bringChildToFront(drawerView); 
    mDrawerLayout.requestLayout(); 
    mDrawerLayout.setScrimColor(Color.TRANSPARENT); 

} 

bringChildToFront ve requestLayout yöntemini geçersiz kılar. Gölgeyi doğru şekilde oluşturmak için bir geçici çözüm bulamadığım için çok kötü. Bu yardımcı olur umarım.

İlgili konular