Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.bilsay;
- import android.app.Activity;
- import android.content.res.Resources;
- import android.os.Bundle;
- import android.view.Menu;
- import android.view.MenuItem;
- import android.view.View;
- import android.widget.Button;
- import android.widget.CheckBox;
- import android.widget.ImageView;
- import android.widget.TextView;
- public class MainActivity extends Activity {
- Button item1,item2,btn3,btnonay,btnsedef;
- TextView item3,itemtxt;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- item1=(Button)findViewById(R.id.btntıkla);
- item2=(Button)findViewById(R.id.button2);
- item3=(TextView)findViewById(R.id.textView2);
- btnsedef=(Button)findViewById(R.id.button4);
- btn3=(Button)findViewById(R.id.button3);
- btnsedef.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- // TODO Auto-generated method stub
- item3.setText("Sedef Bilsayın sevgilisidir");
- }
- });
- item1.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- // TODO Auto-generated method stub
- item3.setText("Hoşgeldiniz");
- }
- });
- item2.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- // TODO Auto-generated method stub
- item3.setText("Merhaba Mavi");
- }
- });
- btn3.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- // TODO Auto-generated method stub
- setContentView(R.layout.che);
- }
- });
- }
- package com.example.bilsay;
- import android.app.Activity;
- import android.content.Intent;
- import android.os.Bundle;
- import android.view.Menu;
- import android.view.View;
- import android.widget.Button;
- import android.widget.CheckBox;
- import android.widget.ImageView;
- import android.widget.TextView;
- public class che extends Activity{
- CheckBox chkc1,chkc2,chkc3,chkc4,chkc5;
- ImageView image;
- Button btnonay,btntıkla;
- TextView itemtxt;
- int c=0;
- @Override
- protected void onCreate(Bundle bilsayiyicocuktur) {
- // TODO Auto-generated method stub
- super.onCreate(bilsayiyicocuktur);
- setContentView(R.layout.che);
- Thread timer=new Thread(){
- public void run(){
- try{
- sleep(5000);
- //Class myclass=Class.forName("com.example.bilsay.che");
- }
- catch(InterruptedException e ){
- e.printStackTrace();
- }
- finally{
- Intent openChe =new Intent("com.example.bilsay.che");
- startActivity(openChe);
- }
- }
- };
- timer.start();
- chkc1=(CheckBox)findViewById(R.id.checkBox1);
- chkc2=(CheckBox)findViewById(R.id.checkBox2);
- chkc3=(CheckBox)findViewById(R.id.checkBox3);
- chkc4=(CheckBox)findViewById(R.id.checkBox4);
- chkc5=(CheckBox)findViewById(R.id.checkBox5);
- btnonay=(Button)findViewById(R.id.btnonay);
- image=(ImageView)findViewById(R.id.imageView1);
- itemtxt=(TextView)findViewById(R.id.chesonuc);
- btntıkla=(Button)findViewById(R.id.btnblsay);
- btntıkla.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- // TODO Auto-generated method stub
- c++;
- itemtxt.setText("Tıkladın "+c);
- }
- });
- btnonay.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- // TODO Auto-generated method stub
- itemtxt.setText("el mature");
- if(chkc1.isChecked()){
- itemtxt.setText("Kisi");}
- else if(chkc2.isChecked())
- itemtxt.setText("Rahmetli Arjantinli Devrimci");
- else if(chkc3.isChecked())
- itemtxt.setText("Ben");
- else if(chkc4.isChecked())
- itemtxt.setText("Nimet anlamnıa gelir");
- else if(chkc5.isChecked())
- itemtxt.setText("el mature");
- }
- });
- }
- }
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
- <TextView
- android:id="@+id/textView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hangisinin Anlamını Öğrenmek İstiyorsun ???"
- android:textSize="23dp" />
- <CheckBox
- android:id="@+id/checkBox1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="El Peblo" />
- <CheckBox
- android:id="@+id/checkBox2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Che" />
- <CheckBox
- android:id="@+id/checkBox3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Bilsay" />
- <CheckBox
- android:id="@+id/checkBox4"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Namet" />
- <CheckBox
- android:id="@+id/checkBox5"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Olgun" />
- <ImageView
- android:id="@+id/imageView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
- <Button
- android:id="@+id/btnonay"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Onay!" />
- <TextView
- android:id="@+id/chesonuc"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Sonuç:"
- android:textSize="@dimen/bigdimension" />
- <Button
- android:id="@+id/btnblsay"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Tıkla" />
- </LinearLayout>
Add Comment
Please, Sign In to add comment