Designing user interface with using views



Download 347,24 Kb.
bet10/10
Sana22.02.2022
Hajmi347,24 Kb.
#89070
1   2   3   4   5   6   7   8   9   10
Bog'liq
6-maruza

Abdukarim

Sardor

Adburashid

Abdusattor

Samandar

Abdulaziz

Ravshan

Rashid

Ulugbek

Sarvar

Fazliddin

4. BasicViews6Activity.java файли қуйидагича ўзгартирилади:

4. BasicViews6Activity.java файли қуйидагича ўзгартирилади:

// Add import sections by yourself

public class BasicViews6Activity extends Activity {

String[] presidents;

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

names=getResources().getStringArray(R.array. names_array);

Spinner s1 = (Spinner) findViewById(R.id.spinner1);

ArrayAdapter adapter = new ArrayAdapter(this,

android.R.layout.simple_spinner_item, names);


BasicViews6Activity.java

s1.setAdapter(adapter);

s1.setAdapter(adapter);

s1.setOnItemSelectedListener(new OnItemSelectedListener(){

@Override

public void onItemSelected(AdapterView arg0,

View arg1, int arg2, long arg3)

{

int index = arg0.getSelectedItemPosition();

Toast.makeText(getBaseContext(),

“You have selected item : “ + names[index],

Toast.LENGTH_SHORT).show();

}

@Override

public void onNothingSelected(AdapterView arg0) { }

});

} // onCreate method is closed

} // BasicViews6Activity.java class is closed


BasicViews6Activity.java

Адабиётлар

  • Beginning AndroidTM 4 Application Development”, by Wei-Meng Lee, printed at Radha Offset, Delhi in 2013, pages – 533. Chapter-4. Designing your user interface with views
  • http://www.tutorialspoint.com/android/android_user_interface_controls.htm
  • http://www.tutorialspoint.com/android/android_event_handling.htm

Download 347,24 Kb.

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




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

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish