I added a simple Seekbar to the project and started it up on the emulator with 1500mb of SDCard and 3.2 Android (WXGA screen).
The code looks so:
SeekBar thisSeek = (SeekBar) seekBar;
currentISOLanguage = Locale.getDefault().getISO3Language();
int thisSeekTag = Integer.parseInt(seekBar.getTag().toString());
TextView txtValue = null;
String theValue = null;
switch(thisSeekTag) {
case 1: // car
if (currentISOLanguage.compareTo("ara") == 0) { //is arabish
progress = 400 - progress;
}
thisSeek.setMax(400);
carValue = progress * 200;
theValue = Integer.toString((int)carValue);
txtValue = (TextView)findViewById(R.id.carValue);
break;
DecimalFormat df = new DecimalFormat("#");
txtValue.setText(df.format(Integer.parseInt(theValue)).toString());
It works but it runs very slow. When I slide the bar the arrow moves very slow. The same is not happening with seekbars without code. Is this an issue of the emulator which slow runs or may be the same problem could be encountered even on real device ?
I solved the issue.. It seems that if the LinearLayout containing the seekbars uses weights but for the default width or height is not specified 0px or 0dips, the seekbars in the emulator slows down. But on a real device couldn’t test it yet..So let’s see.