可以将adapterview用于android中的intent调用

时间:2015-08-21 02:16:47

标签: android

我正在尝试运行以下代码,它在以前版本的android studio中运行但在最新版本中没有运行,有什么问题

错误显示在行中 - > adapterview = new Intent(this,Class.forName(" com.project.hdl.hdl.inputfile"));是inputfile是java类的不兼容类型

{ public void onItemClick(AdapterView adapterview, View view, int i, long l)
{
    itemname = verilogArray[i];
    try
    {
        adapterview = new Intent(this,Class.forName("com.project.hdl.hdl.inputfile"));
        adapterview.putExtra("itemName", (new StringBuilder("verilog/")).append(itemname).toString());
        startActivity(adapterview);
        return;
    }
    // Misplaced declaration of an exception variable
    catch (AdapterView adapterview)
    {
        adapterview.printStackTrace();
    }
}}

0 个答案:

没有答案