NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Ana Ekran Main Activity
class
MainActivity : AppCompatActivity() {
override fun
onCreate(savedInstanceState: Bundle?) {
super
.onCreate(savedInstanceState)
setContentView(R.layout.
activity_main
)
setSupportActionBar(toolbar)
var
name =
""
var
cinsiyet =
""
var
cinsiyetk=
0
var
cinsiyete =
0
var
yas:Int =
0
var
ebyas:Int =
0
var
ekyas =
200
var
maas:Int =
0
var
bilgi = ArrayList<String>()
var
sayac =
0
//var stringArray = Array<String>(sayac)
rgroupCinsiyet.setOnCheckedChangeListener
{
radioGroup, i
->
val
RadioGroup : RadioButton = findViewById(i)
cinsiyet = RadioGroup.
text
.toString()
}
btnEkle.setOnClickListener
{
name =etextName.
text
.toString()
yas = etextYas.
text
.toString().
toInt
()
maas = etextMaas.
text
.toString().
toInt
()
bilgi.add(sayac,
"
İ
sim: "
+name+
" Cinsiyet:
"
+cinsiyet+
" Yas: "
+yas+
" Maas: "
+maas)
sayac++
}
btnListele.setOnClickListener
{
var
adapterSpinner =
ArrayAdapter(
this
,android.R.layout.
simple_spinner_dropdown_ite
m
,bilgi)
adapterSpinner.setDropDownViewResource(android.R.layout.
simple
_spinner_dropdown_item
);
spinnerListe.setAdapter(adapterSpinner);
//spinnerListe.adapter = adapterSpinner
}
btnGec.setOnClickListener
{
if
(yas>ebyas)
{
ebyas=yas
}
if
(yas<ekyas)
{
ekyas=yas}
var
toast = Toast.makeText(
this
,
"Girilen En Büyük Ya
ş
:
"
+ebyas,Toast.
LENGTH_LONG
).show()
var
digerEkranaGecis =
Intent(
this
,Main2Activity::
class
.
java
)
digerEkranaGecis.putExtra(
"ebyas"
,ebyas)
digerEkranaGecis.putExtra(
"ekyas"
,ekyas)
startActivity(digerEkranaGecis)
}
fab.setOnClickListener
{
view
->
Snackbar.make(view,
"Replace with your own
action"
, Snackbar.
LENGTH_LONG
)
.setAction(
"Action"
,
null
).show()
}
}
override fun
onCreateOptionsMenu(menu: Menu): Boolean {
// Inflate the menu; this adds items to the action bar
if it is present.
menuInflater
.inflate(R.menu.
menu_main
, menu)
return true
}
override fun
onOptionsItemSelected(item: MenuItem):
Boolean {
// Handle action bar item clicks here. The action bar
will
// automatically handle clicks on the Home/Up button,
so long
// as you specify a parent activity in
AndroidManifest.xml.
return when
(item.
itemId
) {
R.id.
kirmizi
->
{arkaPlan.setBackgroundColor(Color.
RED
)
true
}
R.id.
sari
->
{arkaPlan.setBackgroundColor(Color.
YELLOW
)
true
}
R.id.
yesil
->
{arkaPlan.setBackgroundColor(Color.
GREEN
)
true
}
R.id.
beyaz
->
{arkaPlan.setBackgroundColor(Color.
WHITE
)
true
}
else
->
super
.onOptionsItemSelected(item)
}
}
}
Menu Text
<
menu
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"
tools
:context=
"com.x.afinal.MainActivity"
>
<
item
android
:id=
"@+id/kirmizi"
android
:orderInCategory=
"100"
android
:title=
"Kırmızı"
app
:showAsAction=
"never"
/>
<
item
android
:id=
"@+id/sari"
android
:orderInCategory=
"100"
android
:title=
"Sarı"
app
:showAsAction=
"never"
/>
<
item
android
:id=
"@+id/yesil"
android
:orderInCategory=
"100"
android
:title=
"Ye
ş
il"
app
:showAsAction=
"never"
/>
<
item
android
:id=
"@+id/beyaz"
android
:orderInCategory=
"100"
android
:title=
"Beyaz"
app
:showAsAction=
"never"
/>
</
menu
>
String.Xml

--------------------------------------------------------------------------------------

2. Ekran Kotlin
class
Main2Activity : AppCompatActivity() {
override fun
onCreate(savedInstanceState: Bundle?) {
super
.onCreate(savedInstanceState)
setContentView(R.layout.
activity_main2
)
var
ebyas =
intent
.getIntExtra(
"ebyas"
,
0
)
var
ekyas =
intent
.getIntExtra(
"ekyas"
,
0
)
textViewMaxYas.
text
=ebyas.toString()
//textViewMinYas.text=ekyas.toString()
var
cins =
resources
.getStringArray(R.array.
cinsiyet
)
val
adapter =
ArrayAdapter(
this
,R.layout.
support_simple_spinner_dropdown_ite
m
,cins)
spinner.
adapter
=adapter;
}
}
     
 
what is notes.io
 

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

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.