Getting The Values Of Seekbars And Passing Values As Intents To New Activity
I am getting NULL values in AndroidTabRestaurantDescFilterListView.java Filters.java public class Filters extends Activity implements OnSeekBarChangeListener{ // declare text
Solution 1:
seekbar.getProgress()
returns an int value.
public synchronized intgetProgress ()
Added in API level 1
Get the progress bar's current level of progress. Return 0 when the progress bar isin indeterminate mode.
Returns
the current progress, between 0 andgetMax()
So when retrieving values use
int PriceBar = getIntent().getIntExtra("PriceBar",0);
int DistanceBar = getIntent().getIntExtra("DistanceBar",0);
int RatingBar = getIntent().getIntExtra("RatingBar",0);
getIntExtra
publicintgetIntExtra (String name, int defaultValue)
Added in API level 1
Retrieve extended data from the intent.
Parameters
name The name of the desired item.
defaultValue the value to be returned if no value of the desired type is stored with the given name.
Returns
the value of an item that previously added withputExtra() or the defaultvalueif none was found.
Solution 2:
String PriceBar = getIntent().getStringExtra("PriceBar");
Should be
int p = getIntent().getIntExtra("PriceBar")
Post a Comment for "Getting The Values Of Seekbars And Passing Values As Intents To New Activity"