Notes
Notes - notes.io |
override fun onCreate(savedInstaState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
var cinsiyet:String = ""
rgCins.setOnCheckedChangeListenes(
RadioGroup.OnCheckedChangeListener { group, checkedId ->
val radio: RadioButton = findViewById(checkedId)
cinsiyet = radio.text.toString()
})
var mezun:String=""
rgMezun.setOnCheckedChangeListener(
RadioGroup.OnCheckedChangeListener { group, checkedId ->
val radio: RadioButton = findViewById(checkedId)
mezun = radio.text.toString()
})
btnGonder.setOnClickListener { it:View!
var ad : String = etAd.text.toString()
var dil:String = ""
var progDil:String = ""
if (cbEng.isChecked) dil+= cbEng.text.toString()+","
if (cbFra.isChecked) dil+=cbFra.text.toString()+","
if (cbGer.isChecked) dil+=cbGer.text.toString()
if (cbC.isChecked) progDil+=cbC.text.toString()+","
if (cbCs.isChecked) progDil+=cbCs.text.toString()+","
if (cbJava.isChecked) progDil+=cbJava.text.toString()+","
if (cbPhyton.isChecked) progDil+=cbPhyton.text.toString()+","
if (cbProlog.isChecked) progDil+=cbProlog.text.toString()+","
if (cbKotlin.isChecked) progDil+=cbKotlin.text.toString()+","
if (cbOracle.isChecked) progDil+=cbOracle.text.toString()+","
val i = Intent ( packageContext: this,Main2Activity::class.java)
i.putExtra( name: "ad", ad)
i.putExtra( name: "cinsiyet",cinsiyet)
i.putExtra( name: "mezun",mezun)
i.putExtra( name: "dil",dil)
i.putExtra( name: "progDil",progDil)
startActivity(i)
}
}
}
--------------------------------- Devamı
class Main2Activity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.lauout.activity_main2)
tvAd.text=intent.getStringExtra( name: "ad")
tvCinsiyet.text = intent.getStringExtra( name: "cinsiyet")
tvMezun.text = intent.getStringExtra( name "mezun")
tvDil.text = intent.getStringExtra( name: "dil")
tvProg.text = intent.getStringExtra( name: "progDil")
}
}
---------------------------------
MainActivity
package com.example.sonornek
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
var sex = ""
rgSex.setOnCheckedChangeListener { group, checkedId ->
val radio: RadioButton = findViewById(checkedId)
var sex = radio.text.toString()
}
var ages = resources.getStringArray(R.array.sAges)
val ageAdater = ArrayAdapter(this,androind.R.layout.simple_spinner_item,ages)
sAge.adapter = ageAdapter
var age = sAge.selectedItem.toString()
val cityAdapter = ArrayAdapter.createFromResource(this,
R.array.sCities, android.R.layout.simple.spinner_item)
cityAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
sCity.adapter = cityAdapter
var city = sCity.selectedItem.toString()
btnLogin.setOnClickListener {
if cbLogin.isChecked) {
var name = eName.text.toString()
var surname = eSurname.text.toString()
var sectionName = eSectionName.text.toString()
var midTerm = emidTerm.text.toString()
var final = eFinal.text.toString()
var i = Intent(this,Main2Activity::class.java)
i.putExtra("name",name)
i.putExtra("surname",surname)
i.putExtra("sectionName",sectionName)
i.putExtra("midTerm",midTerm)
i.putExtra("final",final)
i.putExtra("sex",sex)
i.putExtra("age",age)
i.putExtra("city",city)
startActivity(i)
}
}
}
}
------------Devamı
MainActivity2
class Main2Activity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main2)
tvName.text = intent.getStringExtra("name")
tvSurname.text = intent.getStringExtra("surname")
tvSex.text = intent.getStringExtra("sex")
tvAge.text = intent.getStringExtra("age")
tvCity.text = intent.getStringExtra("city")
tvSectionName.text = intent.getStringExtra("sectionNam")
tvMidterm.text = intent.getStringExtra("midterm")
tvFinal.text = intent.getStringExtra("final")
}
}
string.xml
<resources>
<string name="app_name">sonornek</string>
<string-array name="sCities">
<item>İstanbul</item>
<item>Ankara</item>
<item>Eskişehir</item>
</string-array>
<string-array name="sAges">
<item>15</item>
<item>16</item>
<item>17</item>
<item>18</item>
</string-array>
</resources>
2.dil string.xml
<resources>
<string name"app name">android_final</string>
<string name"name">İsim</string>
<string name"surname">Soyad</string>
<string name"sex">cinsiyet</string>
<string name"male">erkek</string>
<string name"female">Kadın</string>
<string name"age">Yas</string>
<string name"sectionName">Ders Adı</string>
<string name"midterms">Vize</string>
<string name"final">final</string>
<string name"logIn">Giriş Yap</string>
<string name"logMeIn">Giriş yapacak mısınız?</string>
<string name"cities">İller</string>
</resources>
https://youngcomputerist.wordpress.com/2018/12/26/37/
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team