我一整天都在编程,现在我在返回后无法访问;在
return;
Recipe093.path[1] = localCursor.getString(1);
如果我删除返回,我会在继续后得到无法访问的代码;为什么我得到无法访问的代码?希望有人可以帮助我,谢谢。这是我的代码:
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;
}
}
}