Why not add SampleView to your main.xml? You could then add a button
to main.xml as well. Another approach may be to do hit testing within
SampleView. You could draw a bitmap of your "button" then detect if
the user click in/on that area.

On Feb 5, 11:19 pm, ipeg.stud...@gmail.com wrote:
> Hi all
>
>                 Thanks for the greate replies. I have a porgram by
> which i draw a rectengle. The code is written below.
>
> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
>  public class Hellobye2 extends Activity {
>
>            SampleView mView;
>                protected void onCreate(Bundle savedInstanceState) {
>        super.onCreate(savedInstanceState);
>                mView = new SampleView(this);
>             setContentView(mView);
>
>        }
>
> }
>
> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
> Now my problem is I want to insert a button in this page. But i cant
> use setContentView(R.layout.main);
>
> How can i crerate a button which is defiend on main.xml. Please give
> me the appropiate code.
> Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to