2011-09-15 2 views
0

나는 다음과 같은 XML 레이아웃이 있습니다안드로이드 허니 콤 ListView를로드 없지만 예외하지 않습니다 중 하나

String lv_arr[]={"Android","iPhone","BlackBerry","AndroidPeople"}; 
ListView locationsLV = (ListView)findViewById(R.id.locations_view); 
locationsLV.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1 , lv_arr)); 
: ListView에로드 할

<LinearLayout 
     android:id="@+id/map_locations_list" 
     android:layout_width="300dp" 
     android:layout_height="fill_parent" 
     android:layout_marginLeft="8dp" 
     android:layout_marginTop="8dp" 
     android:layout_marginBottom="8dp" 
     android:background="@color/black_shadow" 
     android:layout_gravity="left"> 

      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:orientation="vertical"> 
       <TextView 
        android:id="@+id/location_results_info" 
        android:layout_width="fill_parent" 
        android:layout_height="56dp" 
        android:background="@android:color/white" 
        android:text="Stuff goes here" 
        android:padding="10dp" 
       /> 
       <ListView 
        android:id="@+id/locations_view" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:layout_weight="1.0" 
       /> 
       <TextView 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:text="this is a test" /> 
      </LinearLayout> 
    </LinearLayout> 

<fragment class="fragmentClass" 
    android:id="@+id/fragmentId" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"/>  

그리고 다음과 같은 자바 코드를

ListView에 값이로드되지 않지만 그래서 예외는 발생하지 않습니다. 내가 뭘 잘못하고 있는지 모르겠다. 나는 내 코드에 대한 근거로이 예제를 사용 : http://www.androidpeople.com/android-listview-example

+0

예외 발생 ??? –

답변

1

확인이 XML 및 ............. 그 구성 요소의 overllapping 수있는 다른 구성 요소를 추가 한 후 처음으로 시도하고

<?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout android:id="@+id/locations_view" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android"> 
    <ListView android:id="@+id/ListView01" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" /> 
    </LinearLayout> 
+0

감사합니다.이 방법이 효과적이었습니다. – CACuzcatlan

관련 문제