Video summary

안드로이드 앱 만들기 #3 (Intent 화면전환) - 쉽게 앱 만드는 방법 (현직 개발자 설명) , android studio easy tutorial

Main summary

Key takeaways

Technology

Main focus / concepts covered

This tutorial demonstrates how to navigate between Activities (screens) in an Android app using Intents and how to pass data between them.

Key concepts:

  • What an Intent is: the mechanism to navigate between Activities.
  • Creating a second Activity (SubActivity) and its layout XML so you can move from Activity A → Activity B.
  • Wiring UI elements in XML (Button, EditText, TextView), assigning IDs, and connecting them in Java with findViewById.
  • Handling clicks with OnClickListener to trigger navigation.
  • Creating and using an Intent:
    • new Intent(CurrentActivity.this, SubActivity.class)
    • startActivity(intent)
  • Passing data between Activities:
    • Put data into the Intent before starting: intent.putExtra("key", value) (e.g., a String from an EditText).
    • Receive data in the destination Activity: getIntent().getStringExtra("key") (or other getXExtra variants) and set it into a TextView.
  • Common Android details and gotchas:
    • Always end Java statements with semicolons.
    • Use Alt+Enter or auto-complete to add imports if needed.
    • Lifecycle/timing bug: do not capture EditText text at app startup if you want the user’s later input — read the EditText and call putExtra inside the button’s click handler so current input is sent.
    • If sending numeric types, convert appropriately (e.g., putExtra / getIntExtra).

Running and testing:

  • Build and run on a physical Android device or an emulator to verify navigation and data passing.
  • This pattern (Intent + putExtra / getIntent) is widely used and practical in real apps.

Step-by-step guide (high-level)

  1. Create a project and add a new Activity (e.g., SubActivity) via New → Activity.
  2. Edit layout XMLs:
    • Use a LinearLayout.
    • Add an EditText for input, a Button (Move), and a TextView to show received text.
  3. In MainActivity.java:

    • Declare and initialize UI references: java EditText editText = findViewById(R.id.xxx); Button btnMove = findViewById(R.id.xxx);

    • In btnMove.setOnClickListener: java btnMove.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String text = editText.getText().toString(); Intent i = new Intent(MainActivity.this, SubActivity.class); i.putExtra("sdr", text); startActivity(i); } });

  4. In SubActivity.java: java TextView tvSub = findViewById(R.id.tv_sub); String s = getIntent().getStringExtra("sdr"); tvSub.setText(s);

  5. Fix lifecycle issues by ensuring data is fetched and put into the Intent at the moment the user clicks the button (not at app startup).

Tip: always call editText.getText().toString() inside the click handler so you send the current input.


Troubleshooting tips

  • If text isn’t passed, check that you call editText.getText().toString() inside the click handler before creating/starting the Intent.
  • Verify IDs in XML match those used in findViewById().
  • Use auto-import (Alt+Enter) for missing imports.
  • Watch the logcat and run on an emulator/device to confirm behavior.

Lifecycle/timing bug: do not capture EditText text at startup; read it and call putExtra inside the button’s click handler so the user’s current input is sent.


Additional notes

  • Instructor briefly mentions UI tweaks (text size using sp), layout choices (e.g., LinearLayout), and project/theme settings.
  • There is an offline chat/Q&A available (per instructor) for follow-up questions.

Main speaker / source

  • Hoeung Druid (현직 개발자)

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video