我有這樣的代碼:的ListView PutExtra任何回報
list.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> p1, View p2, int p3, long p4)
{
//Toast.makeText(getActivity().getApplicationContext(), "", Toast.LENGTH_SHORT).show();
Intent epActivity = new Intent(getActivity().getApplicationContext(), EpisodeActivity.class);
epActivity.putExtra(POSITION, p3);
startActivity(epActivity);
}
});
而這種代碼在我EpisodeActivity:
Intent i = getIntent();
String pos = i.getStringExtra(MainActivity.PlaceholderFragment.POSITION);
,問題是,我得到一個空pos
變量。 怎麼回事?