UA-24399986-1
Facebook Twitter Gplus YouTube RSS
Home ANDROID Android ile Button Click Uygulaması
formats

Android ile Button Click Uygulaması

Published on 08/01/2012 by in ANDROID, MOBİL

Android uygulamalarımızda çokça işe yarayacak olan Button widget i kullanmak için ilk önce yeni bir proje oluşturalım ve projemize “android button” ismini verelim.

 

 

 

 

 

 

Projemizi oluşturduktan sonra “res/layout” içerisinde bulunan “main.xml” dosyasını açalım ve “graphical layout” sekmesinden bir adet “edittext” ve “button” u uygulama masasına  ekleyelim.

 

 

 

“AndroidbuttonActivity.java” dosyasını açalım ve aşağıdaki kodları ekleyin.

package your.androidbutton;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class AndroidbuttonActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Button button1=(Button) findViewById(R.id.button1);
        final TextView textview1=(TextView) findViewById(R.id.textview1);
        final EditText edittext1=(EditText) findViewById(R.id.editText1);

        button1.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				textview1.setText(edittext1.getText());

			}
		});
    }
}

 

Uygulamamızı çalıştıralım ve sonucu görelim.

 

Artık “edittext” içerisine girmiş olduğumuz kelime “textview” da görüntülenmektedir.

 KAYNAK KODU İNDİR

VN:F [1.9.17_1161]
Rating: 8.3/10 (4 votes cast)
VN:F [1.9.17_1161]
Rating: +1 (from 1 vote)
Android ile Button Click Uygulaması, 8.3 out of 10 based on 4 ratings
Create PDF    Send article as PDF   
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

You need to log in to vote

The blog owner requires users to be logged in to be able to vote for this post.

Alternatively, if you do not have an account yet you can create one here.

Powered by Vote It Up

© [Creative Commons BY-SA-NC 3.0]
credit