Listing 113 srccomcookbookadvanceShowMyButtonjava

package com.cookbook.advance.customComponent;

import; import android.os.Bundle;

public class ShowMyButton extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);


MyButton myb = (MyButton)findViewByld(;

myb.setText("Hello Students"); myb.setTextSize(40);

This shows the custom button is used the same as a normal Button widget. The resulting custom button is shown in Figure 11.1.

Figure 11.1 An example of a custom button.

Was this article helpful?

0 0
Character Building Thought Power

Character Building Thought Power

Character-Building Thought Power by Ralph Waldo Trine. Ralph draws a distinct line between bad and good habits. In this book, every effort is made by the writer to explain what comprises good habits and why every one needs it early in life. It draws the conclusion that habits nurtured in early life concretize into impulses in future for the good or bad of the subject.

Get My Free Ebook

Post a comment