Declare a static String to store the name of the button which was clicked.
public static String buttonName;
Now, whenever any button is clicked, add the name of that button in the String.
myButton.setOnClickListener(new OnClickListener()
{ @Override
public void onClick(View v)
{ buttonName = "myButtonNumberX";
Intent intent = new Intent(context, PickHeatActivity.class);
startActivity(intent); }
}
);
Then, in your new PickHeatActivity, you can just access the name of the button by using MyMainActivityName.buttonName
.