I am trying to code so I get a message saying "Progress changed" when I move a seekbar but my code is not working.
textView = (TextView) findViewById(R.id.textView1);
seekBar = (SeekBar) findViewById(R.id.seekBar1);
Listener seekChange = new Listener();
seekBar.setOnSeekBarChangeListener(seekChange);
The inner class is:
private class Listener implements OnSeekBarChangeListener
When the screen rotates my seekbar's colored bar goes back to its initial value, while the thumb remains at the correct position.
Basically from this:
It becomes like this:
Note that the TextView showing 15 is connected to the seekbar and correctly shows the same value, which is updated in onCreateView retrieving the value with getProgress on the seekbar, so the seekbar has the correct prog
i uses seekBar to pass value increase/decrease by user... i put the initial value of barValue=50. when user drag seekbar lesser than current value.. the a,b decreases by 0.00001.
Problem i face. its only do the IF condition onced. after seekBar updated.. no changes on a and b.
Link successfully established and able to send data.
Android is sending SeekBar data when ever we change it.
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if(seekBar.getId() == R.id.seekBar)
{
speed.setText(String.valueOf(progress));
String outputData = String.valueOf(progress);
streams.write(outputData.getBytes());
}
}
str
I am a self taught new android/java developer and know just enough to realize i don't know nearly enough.
I have an array that I need to access the elements of dependant on which item in a listView has been clicked.
The first int value sent to the getView() method i.e int arg0 is this the ID of the element of the array that has been clicked?
I'm trying to pass something from one class to my MainActivity, but it doesn't seem to work, I don't understand why.
I have my GPS Tracker on another class (not the MainActivity) in order to reuse it.
When the location changes, I want my other class to call a method from within the MainActivity to update my UI.
I summarized my code like that :
My MAIN ACTIVITY :
public class MainActivity exten
This is the listener i have on my viewPager:
viewPager.setOnPageChangeListener(new OnPageChangeListener() {
@Override
public void onPageSelected(int arg0) {
pageNr.setText("page: " + (viewPager.getCurrentItem() + 1) + "/" + viewPager.getChildCount());
currentSlide = viewPager.getCurrentItem();
page = viewPager.getCurrentItem();
view
I have two grid view, I need synchronize it, when I scrolling one, second must scrolling the same.