我在ListActivity中收到警告.我得到的警告如下所示
>类是原始类型.对泛型类型< T>的引用.应该
参数
它没有造成任何问题,但我想知道为什么我会得到这个警告以及如何抑制它.查看用星号写的行.
public class Menu extends ListActivity {
String classes[]={"Second","example1","example2","example3","example4"};
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter(Menu.this,android.R.layout.simple_list_item_1,classes));
}
@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.app1."+cheese);**
Intent ourintent= new Intent(Menu.this,ourclass);
startActivity(ourintent);
}catch(ClassNotFoundException e){
e.printStackTrace();
}
}
}