So i have 2 activities that link to each other through an intent, but i need the second page to know what was clicked in the previous page. Heres what i mean.
public class featuredvendors extends AppCompatActivity {
public String nextpageref;
The string i would like to edit is declared above.
t2.setOnClickListener(new View.OnClickListener(){
public void onClick(View v){
nextpageref="post1";
Intent t2 = new Intent(featuredvendors.this, featureddetails.class);
startActivity(t2);
}
});
So essentially, i want to change the value of nextpageref based on what was clicked on. However it seems that i cant change the value inside an onClick block. Is there anyway i can pass the value "post1" to a string, but ONLY when this particular button is clicked? I need it this way because the next page 'featureddetails' needs to know this String value in order to pull the correct information from the DB.