2013-03-24 1 views
-1

Я пытаюсь создать «ListActivity», но я не могу видеть вывод как список. Я использовал код людей. Более того, у меня не было ошибок в нижеприведенном коде. Пожалуйста, помогите в решении этой проблемы.android listactivity

package com.wordpress.sree7k7;

import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView;

общественного класса меню расширяет ListActivity {

String classes[]={ "MainActivity", "example1","example2", 
     "example3","example4","example5","example6"}; 
@Override 


protected void onCreate(Bundle savedInstanceState) { 
    // TODO Auto-generated method stub 

    super.onCreate(savedInstanceState); 
    setListAdapter(new ArrayAdapter<String>(Menu.this, android.R.layout.simple_expandable_list_item_1)); 
}@Override 
protected void onListItemClick(ListView l, View v, int position, long id) { 
    // TODO Auto-generated method stub 
    super.onListItemClick(l, v, position, id); 
    String cheese = classes[position]; 
    try { 
    Class ourClass = Class.forName("com.wordpress.sree7k7.Menu"+ cheese); 
    Intent ourIntent= new Intent(Menu.this, ourClass); 
    startActivity(ourIntent); 
    }catch(ClassNotFoundException e){ 
     e.printStackTrace(); 
    } 
} 

}

ответ

0

попробуйте изменить bgcolor нашегоClass, чтобы вы могли выяснить, не отображается ли ваш список или он уже начинает работу newClickClass