Android Studio: Call Activity

From OnnoWiki
Revision as of 09:31, 3 March 2022 by Onnowpurbo (talk | contribs) (Created page with "How can I call another activity from one (the current) activity? Use the Intent to call another Activity. In the Manifest, you should add <activity android:name="ListViewIm...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

How can I call another activity from one (the current) activity?

Use the Intent to call another Activity. In the Manifest, you should add

<activity android:name="ListViewImage"></activity>
<activity android:name="com.company.listview.ListViewImage">
</activity>


And in your current activity,

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();
        }
    });