I have an Android App using Fragments to create a sliding view. I have 5 "Buttons" represented by FrameLayouts with content in them in Fragment A and Fragment B.
When clicking a Layout it turn green for a few seconds, and the others don't in that space of time:
c05.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (Storage.isWaiting)
return;
Storage.isWaiting = true;
Toast.makeText(getActivity().getApplicationContext(), "Text abc 123", Toast.LENGTH_LONG).show();
c05.setBackgroundColor(Color.parseColor("#ff408c3a"));
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
c05.setBackgroundColor(Color.parseColor("#393939"));
Storage.isWaiting = false;
}
}, 3000);
}
});
I now need the to fragments to "syncronize" in a way that when i press button c01 in Fragment A c01 in Fragment B becomes green as well.
Do you have any Ideas how to do that?