# Start the activity connect to the
# specified class
Intent i = new Intent(this, ActivityTwo.class);
startActivity(i);
Boshqa Android faoliyati tomonidan boshlangan harakatlar sub-faoliyatlar deb
ataladi. Ushbu so'z qaysi faoliyatni nazarda tutayotganini tasvirlashni
osonlashtiradi.
Intent
lar
orqali
xizmatlarni
ishga
tushirish
uchun
startService(Intent) usuli chaqiruvidan foydalaning.
Aniq yoki yashirin Intent larni yuborishni kod qismi:
i.putExtra("Value1", "This value one for ActivityTwo ");
i.putExtra("Value2", "This value two ActivityTwo");
Intent
i
=
new
Intent(Intent.ACTION_VIEW,
Uri.parse("https://www.vogella.com/"));
startActivity(i);
Ushbu faoliyatning juda soddalashtirilgan tartib fayli quyidagicha ko'rinishi
mumkin.
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
android:id="@+id/userlabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:text="User name"
android:textSize="24sp"
/>
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Do'stlaringiz bilan baham: |