PowenKo, Android, Tutorial 012, UI, EditView

August 25, 2011   ·   0 Comments

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView

android:id="@+id/textView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hello"
    />
<EditText
android:id="@+id/editText1"
android:layout_height="wrap_content"
    android:text="PowenKo.com"
android:layout_width="fill_parent">
    <requestFocus></requestFocus>
</EditText>
</LinearLayout>

 

package com.powenko.Tutorial_UI_EditText;

import android.app.Activity;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;

public class Tutorial_UI_EditTextActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TextView t_textView_title = (TextView)findViewById(R.id.textView1);
        t_textView_title.setText("Food");

        EditText t_EditText = (EditText)findViewById(R.id.editText1);
        String t1=t_EditText.getText().toString();

        t_textView_title.setText(t1);
        t_EditText.setText("San Francisco");

    }
}

sample code:

Tutorial_UI_EditText

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Android7

Amazon

adsbygoogle

Recent Posts

Categories

Amazon