2012-02-13 81 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

相关问题