Momo1199 2013-01-04 03:19 采纳率: 0%
浏览 1536
已结题

在android中Unreachable问题

我卡了好长时间了,在return的Unreachable:

return; Recipe093.path[1] = localCursor.getString(1);

如果删除return,继续运行就会获取unreachable,不知道该怎么解决了啊,请帮忙:

代码如下:

public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(R.layout.musiclist);
    final Cursor localCursor = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, (String[])null, null, (String[])null, null);
    String[] arrayOfString1 = localCursor.getColumnNames();
    int i = arrayOfString1.length;
    for (int j = 0; ; j++)
    {
      if (j >= i)
      {
        String[] arrayOfString2 = { "title", "artist", "duration" };
        int[] arrayOfInt = { 2131099668, 2131099669, 2131099670 };
        SimpleCursorAdapter localSimpleCursorAdapter = new SimpleCursorAdapter(getApplicationContext(), 2130903044, localCursor, arrayOfString2, arrayOfInt);
        localSimpleCursorAdapter.setViewBinder(new AudioListViewBinder());
        ListView localListView = (ListView)findViewById(2131099667);
        localListView.setAdapter(localSimpleCursorAdapter);
        Log.d("test", "start list()");
        localListView.setOnItemClickListener(new AdapterView.OnItemClickListener()
        {
          public void onItemClick(AdapterView<?> paramAnonymousAdapterView, View paramAnonymousView, int paramAnonymousInt, long paramAnonymousLong)
          {
            switch (Recipe093.this.getIntent().getIntExtra("case1", 0))
            {
            default:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            case 11:
            case 12:
            case 13:
            case 14:
            case 15:
            case 16:
            }
            while (true)
            {
              Intent localIntent = new Intent(Recipe093.this.getApplicationContext(), MainActivity.class);
              Recipe093.this.startActivity(localIntent);
              return;
              Recipe093.path[1] = localCursor.getString(1);
              SharedPreferences.Editor localEditor10 = Recipe093.this.getSharedPreferences("FileName", 3).edit();
              localEditor10.putString("userChoice", Recipe093.path[1]);
              localEditor10.commit();
              continue;
              Recipe093.path[2] = localCursor.getString(1);
              SharedPreferences.Editor localEditor9 = Recipe093.this.getSharedPreferences("FileName", 3).edit();
              localEditor9.putString("userChoice1", Recipe093.path[2]);
              localEditor9.commit();
            } 
          }
        });
        return;
      }
      Log.d("Recipe093", arrayOfString1[j]);
    }
  }

  private class AudioListViewBinder
    implements SimpleCursorAdapter.ViewBinder
  {
    private AudioListViewBinder()
    {
    }

    public boolean setViewValue(View paramView, Cursor paramCursor, int paramInt) {
        // TODO Auto-generated method stub
          int i = paramCursor.getColumnIndex("title");
          int j = paramCursor.getColumnIndex("artist");
          int k = paramCursor.getColumnIndex("duration");
          if ((paramInt == i) || (paramInt == j))
            ((TextView)paramView).setText(paramCursor.getString(paramInt));
        return false;
    }

  }
  }
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog