fry15/uk.co.jasonfry.android.tools — Issue #5: .getChildCount() returns always 1
Author: ChristopheVersieux
Created: 2011-10-16 10:49:05+00:00
State: open

Dear Jason, thank alot for your great work.

I have just a little complain about something that might a bug in .getChildCount().

I my activity, I am adding 20 views to the SwipeView programmatically like this:

private void addEvent(String teams, String score, String event, Long timestamp,
int drawableTeam1, int drawableTeam2) {
LayoutInflater inflater = (LayoutInflater) getBaseContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.otherevent, null);
(...)
sv.addView(view);
}

and I am now trying to smoothScroll to a random page like this:

sv = (SwipeView) findViewById(R.id.swipeView);
Toast.makeText(getBaseContext(), ""+sv.getChildCount(), Toast.LENGTH_SHORT).show();
sv.smoothScrollToPage((int) (Math.random() * 20));

The issue is that the toast and getChildCount tells me result is '1'

Maybe I am doig something wrong, but seems right.