2012-02-13 79 views
0

即時通訊嘗試填充我的列表視圖下我的選項卡功能,但由於某種原因它沒有出現在我的應用程序。我在外部項目中採樣代碼,它的工作原理,我不知道爲什麼它不出現。我是否在清單中實施了錯誤的活動,或者是否有相反的代碼?選擇按鈕時不會出現錯誤或logcat問題。它只是在選項卡下面的一個空白頁面。該頁面加載但沒有列表。感謝ListView沒有出現在應用程序

XML File 
<?xml version="1.0" encoding="utf-8"?> 
<!-- Single List Item Design --> 
<TextView xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/label" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:padding="10dip" 
    android:textSize="16dip" 
    android:textStyle="bold" > 
</TextView> 

ListmoreActivity

package workout.fitty; 

import android.app.ListActivity; 
import android.os.Bundle; 
import android.widget.ArrayAdapter; 


public class ListmoreActivity extends ListActivity { 
@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 

    // storing string resources into Array 
    String[] adobe_products = getResources().getStringArray(R.array.adobe_products); 

    // Binding resources Array to ListAdapter 
    this.setListAdapter(new ArrayAdapter<String>(this, R.layout.main, R.id.label, adobe_products)); 

} 
} 

在清單中的活動被添加等;

<activity android:name=".ListmoreActivity" /> 

萬一其錯誤

+0

缺少活動 – goodm 2012-02-13 11:50:12

回答

1

您是從代碼的錯誤開始參考下面的鏈接瞭解Android中的ListView ...

http://www.vogella.de/articles/AndroidListView/article.html

+0

的setContentView嘿。我閱讀了這篇文章,並認爲我理解了它,但現在我在頁面上得到了一個「假」的回報。這是什麼原因?任何幫助非常感謝,謝謝。 – memyselfandmyiphone 2012-02-14 12:24:21

+0

可能是你使用教程中提到的其他版本的android.Try來調試你的代碼我自己... – himanshu 2012-02-14 12:46:47

+3

請總結鏈接到頁面的內容在這裏。目前我無法分辨這是否回答問題,如果鏈接移動,這個答案變得比無用的更糟糕。 – ChrisF 2012-02-16 09:30:53

相關問題