import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ScrollView;
import android.widget.TextView;
public class SrcollViewActivity extends Activity {
private TextView textView;
private ScrollView scrollView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
textView=(TextView) findViewById(R.id.textView1);
textView.setText(getResources().getString(R.string.content));
scrollView=(ScrollView) findViewById(R.id.scrollView1);
scrollView.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction())
{
case MotionEvent.ACTION_MOVE:
if (scrollView.getChildAt(0).getMeasuredHeight()<=scrollView.getHeight()+scrollView.getScaleY()) {
textView.append(getResources().getString(R.string.content));
}
break;
}
return false;
}
});
}
}