Laboratoriya ishi №16 Mavzu: Voqealar (intents)


# Start the activity connect to the


Download 444.29 Kb.
Pdf ko'rish
bet2/15
Sana14.12.2022
Hajmi444.29 Kb.
#1004913
1   2   3   4   5   6   7   8   9   ...   15
Bog'liq
Abduraximov Elbek 612 19 guruh, 4 deadline

# 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: 
Intent i = new Intent(this, ActivityTwo.class); 
i.putExtra("Value1", "This value one for ActivityTwo "); 
i.putExtra("Value2", "This value two ActivityTwo"); 
 
Intent 


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" 

Download 444.29 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   15




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling