I have 2 Activities: Mainactivity.xml and Messages_predet.xml
I have a button that directs me to the second activity without problem and it will send other activities, but in each one I have to place a button (imagebutton) that will bring me back to the previous activity, to explain myself better:
If I am in the Messages_predet activity, I return to the Main
I have to create an intent?
This is my imagebutton to return to Mainactivity
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/imageButton"
android:src="@drawable/back"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true">
</ImageButton>
<!-- how to make this imaggebutton to return to Mainactivity??? -->
And this is what I have in the manifesto
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MensajesPredet"
android:label="@string/title_activity_mensajes_predet" >
</activity>
</application>
And this in my MainActivity.java file
package com.globalstar.st300r;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
/** Called when the user clicks the Send button */
public void predefinido(View view) {
Intent intent = new Intent(this, MensajesPredet.class);
startActivity(intent);