Home > Tutorials Home > Android > CustomLayout in Android Application

CustomLayout in Android Application

Published on November 30, -0001 12:00:00 AM

We are an online tutoring company that has laid its foundation in utilizing Multiple Intelligence methodology to understand specific needs and learning styles of a student.So that we patch a particular student to a tutor having a compatible teaching style. We have devised a smart online tutoring system to give you measurable results.Schools, cramped with students, fail to give your child the edge, the motivation and the right teacher guidance to help him find the true potential. We at Eonlinetutors.com make sure that your child gets the perfect learning environment to outperform.

Step 1 : Open the Eclipse and create a new Android project using Blank Activity application template. Give the application name "CustomLayout in Android".

package com.example.customlayoutdemo;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Toast;

public class MainActivity extends Activity
	private LinearLayout ll;
	private EditText et;
	private Button btn;

    public void onCreate(Bundle savedInstanceState)
		// setContentView(R.layout.activity_main);

		ll = new LinearLayout(this);
        et = new EditText(this);
		et.setText("Hi, android");

		btn=new Button(this);
		btn.setText("Click Button");        

		btn.setOnClickListener(new OnClickListener()
			public void onClick(View v)
				String text=et.getText().toString();