Answers for "go back to previous activity android"

2

go to activity android

//going to another activity while ending the 
//previous one so that users cannot go back
btListe = (ImageButton)findViewById(R.id.Button_Liste);
    btListe.setOnClickListener(new OnClickListener()
    {    public void onClick(View v)
        {
            intent = new Intent(main.this, ListViewImage.class);
            startActivity(intent);
            finish();
        }
    });
Posted by: Guest on October-08-2020
0

kotlin return to previous activity

if you use fragment u should use

getActivity().onBackPressed();
if you use single activity u can use

finish();
Posted by: Guest on May-17-2020

Code answers related to "go back to previous activity android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language