Swipe is not swiping


#1

I had to change my code so that it totally uses support.v4.

I run the code, swipe left… nothing. Swipe right… nothing.

I put Log statement in CrimePagerActivity in getCount and getItem. Nothing’s showing up in Logcat.

Where should I be looking?


#2

Silly me I should have put a Log statement in CrimePagerActivity onCreate(). I did that, and nothing in LogCat.

I get the entire listing, I select an item… I swipe, and nothing happens. No error termination either.

What invokes CrimePagerActivity? It looks as if it’s not being called.


#3

CrimePagerActivity is started from CrimeListFragment in the onListItemClick() method.

[code] @Override
public void onListItemClick(ListView l, View v, int position, long id) {
Crime c = ((CrimeAdapter)getListAdapter()).getItem(position);

	// Start CrimePagerActivity
	Intent i = new Intent(getActivity(), CrimePagerActivity.class);
	i.putExtra(CrimeFragment.EXTRA_CRIME_ID, c.getId());
	startActivity(i);
}

[/code]
It’s strange that you can get a crime detail view without the pager working. Do you still have CrimeActivity around because that sounds like its behavior.


#4

YES! That was it exactly. Somehow, I have no idea how, I failed to implement Listing 11.5, 11.6 and 11.7 (what was I thinking?). Anyway, now that I’ve made those selections it swiping has advertised… BUT

no matter what item i choose from the list Crime #0 is what gets displayed. I thought I saw some thread about that on the forum, I’ll have to see if I can find it again. I’d think it’s related to a Listener not choosing the correct item.

Thanks


#5

Found my problem: I failed to include: if(mCrimes.get(i).getId().equals(crimeId)) {

I had put in Log statements to show me was getItem was getting for pos and it was always zero.

Really good book. This forum makes it all work… everyone is helpful.

Thanks