Android Studio: Start another activity

From OnnoWiki
Revision as of 07:37, 4 March 2022 by Onnowpurbo (talk | contribs) (Created page with "==Respond to the Send button== file app > java > com.example.myfirstapp > MainActivity, add the following sendMessage() method stub: public class MainActivity extends AppCo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Respond to the Send button

file app > java > com.example.myfirstapp > MainActivity, add the following sendMessage() method stub:

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    /** Called when the user taps the Send button */
    public void sendMessage(View view) {
        // Do something in response to button
    }
}



Referensi