Take the 2-minute tour ×  On my class, I am using the
setcontentview(R.layout.main2) in which after a point on the
class when a button is pressed am calling a second layout main3.
I don't know, how to use a back button on the second layout in
order to move back on the main2. I try to use the finish();, but
it take me more back on the layout main1. Also, I try to call
again the layout main2, but then my buttons are not working. How
this can be done?   public class Conn extends Activity    public
void onCreate(Bundle mSavedInstanceState)
findViewById(R.id.Devices).setOnClickListener(new
View.OnClickListener() {      public void onClick(View v) {
if (DeviceName==(null))             DeviceName="Not Connected";
final TextView BDConnected = (TextView)
findViewById(R.id.BDConnected);
BDConnected.setText("BD Device Connected :"+DeviceName);
WifiManager wifiManager=(WifiManager)
getSystemService(Context.WIFI_SERVICE);         String
net=wifiManager.getConnectionInfo().getSSID()