• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Using Object to define View in Layout

My post is based on a previous post and greatly simplified from somewhere else that I can no longer find.

(Android: Two Views On Top of Each Other Using XML)

The file/object DrawV populates the screen with pink circles and allows one to touch a circle to make it disappear. In another file, private DrawV drawView = new DrawV(this); This populates the screen but does not participate in the layout.

setContentView(drawView) shows the dots,so I know it works. I want to use a layout named setContentView(R.layout.activity_game); which includes two buttons at the top of the screen and dots below. In other words, I was wondering if there is a method to put the random pink dots shown in some sort of View below that can be included with above buttons in the same layout.

Somebody sent me an answer that my app has issues with:

<com.example.views.DrawV
android:layout_below="@id/buttons" <--@+id/buttons in LinearLayout that includes two Buttons
android:layout_width="match_parent"
android:layout_height="match_parent" />

I changed com.example.views.DrawV to com.category.tap.DrawV. Any help? Please?

Tell me if you need anything.
 
Welcome to Android Forums. :)

I've taken the liberty of moving this to our Application Development section, so that others with experience can advise you.
 
Back
Top Bottom