Create an android project in eclipse and pasted the following code in the main activity class:
package com.rayhan.nothing;
import java.util.Random;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;
public class AndruTestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
View v=findViewById(R.id.mainlayout);
v.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Random rnd=new Random();
v.setBackgroundColor(rnd.nextInt());
}
});
}
}
//------------------------------------------------
And here is the xml file for the layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainlayout"
android:background="@color/white"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
</LinearLayout>
A blog about web application development mainly on backend side
Showing posts with label android. Show all posts
Showing posts with label android. Show all posts
Monday, June 11, 2012
Subscribe to:
Posts (Atom)
What is DaemonSet in Kubernetes
A DaemonSet is a type of controller object that ensures that a specific pod runs on each node in the cluster. DaemonSets are useful for dep...
-
Both .NET and NodeJS are popular programming frameworks that have their own strengths and weaknesses, which makes for an interesting compar...
-
A DaemonSet is a type of controller object that ensures that a specific pod runs on each node in the cluster. DaemonSets are useful for dep...
-
In any software development process, it is crucial to understand the differences between various types of classes. Two such classes are ab...