我正在創建一個Class對象以啓動一項新活動。但問題是當我輸入無法創建「Class」對象
Class ourclass = new Class.__
它無法識別類,我不能使用超類「Class」的方法。它說班級是一種原始類型。我應該將它分配給什麼類型,因爲我想使用「forName()」方法來傳遞類名。 這裏是代碼
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);
try
{
Class ourclass =Class.__ // The suggestions for static functions doesn't popup, and I get errors
//Intent myintent = new Intent();
}
catch(ClassNotFoundException e)
{
e.printStackTrace();
}
}
}
問候。
您需要讓JVM爲您創建一個類,因爲該對象是該類的內部數據結構的代理。 – 2012-08-02 10:22:43