android开发eclipse(列表活动)

android开发eclipse(列表活动),android,eclipse,list,listactivity,Android,Eclipse,List,Listactivity,它用黄色标出了“类”,并警告说“类是原始类型”。对泛型类型类的引用应参数化' Class ourClass = Class.forName("com.thenewboston.jack." + cheese); 我已经尝试了所有的快速修复和每件事。我不知道该怎么办。谁能帮我一下,告诉我怎么办 以下是代码的其余部分以及代码的放置位置: package com.thenewboston.jack; import android.app.ListActivity; import android

它用黄色标出了“类”,并警告说“类是原始类型”。对泛型类型类的引用应参数化'

Class ourClass = Class.forName("com.thenewboston.jack." + cheese); 
我已经尝试了所有的快速修复和每件事。我不知道该怎么办。谁能帮我一下,告诉我怎么办


以下是代码的其余部分以及代码的放置位置:

package com.thenewboston.jack;

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



public class Menu extends ListActivity{

 String classes[] = {"Startingpoint", "Example1", "Example2", "Example3"
            , "Example4", "Example5", "Example6", "Example7", "Example7",  "Example7"};

@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, 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.thenewboston.jack." + cheese);
    Intent ourIntent = new Intent(Menu.this, ourClass);
    startActivity(ourIntent);
    }catch(ClassNotFoundException e){
        e.printStackTrace();
    }


}
}
package com.thenewboston.jack;
导入android.app.ListActivity;
导入android.content.Intent;
导入android.os.Bundle;
导入android.view.view;
导入android.widget.ArrayAdapter;
导入android.widget.ListView;
公共类菜单扩展了ListActivity{
字符串类[]={“起始点”、“示例1”、“示例2”、“示例3”
“例4”、“例5”、“例6”、“例7”、“例7”、“例7”};
@凌驾
创建时受保护的void(Bundle savedInstanceState){
//TODO自动生成的方法存根
super.onCreate(savedInstanceState);
setListAdapter(新的ArrayAdapter(Menu.this,android.R.layout.simple_expandable_list_item_1,classes));
}
@凌驾
受保护的void onListItemClick(列表视图l、视图v、整数位置、长id){
//TODO自动生成的方法存根
super.onListItemClick(左、右、位置、id);
字符串=类[位置];
试一试{
Class-ourClass=Class.forName(“com.thenewboston.jack.+cheese”);
Intent-ourIntent=新的Intent(Menu.this,ourClass);
星触觉(ourIntent);
}catch(classnotfounde异常){
e、 printStackTrace();
}
}
}
像这样修改

Class<Activity> ourClass = Class.forName("com.thenewboston.jack." + cheese);

在生成警告的行上方。

这并不能消除警告类ourClass=Class.forName(“com.thennewboston.jack.+cheese”);然而,这并没有@SuppressWarnings(“rawtypes”)类ourClass=Class.forName(“com.thennewboston.jack.”+cheese);谢谢你的帮助,你能告诉我为什么另一个没用吗?
@SuppressWarnings("rawtypes")