Thanks guys for the help, the problem was solved just by making two different classes, one for buttons and listviews and the other is just for textview...thanks again...
Justin i hope u ll get will soon mate, take care, cheers. On Mar 25, 5:43 am, Justin Anderson <magouyaw...@gmail.com> wrote: > Kostya, > > Thanks for catching my mistake! I had surgery for a deviated septum a > couple days ago and I'm on some pretty heavy meds... Serves me right for > trying to answer some questions while I'm obviously so very loopy! :-) > > Thanks, > Justin Anderson > MagouyaWare Developerhttp://sites.google.com/site/magouyaware > > 2012/3/24 Kostya Vasilyev <kmans...@gmail.com> > > > > > > > > > 25 марта 2012 г. 0:55 пользователь Justin Anderson > > <magouyaw...@gmail.com> написал: > > >> Apen sorry i dint notice ur suggestion, no it's not about the name, > > >> hmm i think it's something wrong with the order of the blocks... > > > > No, it IS about the name... Apen was correct (and that is what I was > > trying > > > to say before, but was REALLY tired so I apologize for the incoherent > > > replies). > > > >> mNewDevicesArrayAdapter = new ArrayAdapter<String>(this, > > >> R.layout.textviewlayout); > > > > That is incorrect... You should not be passing in an R.layout here... you > > > should be passing in an R.id > > > No. > > > The two-argument constructor takes a *layout* id: > > >https://github.com/android/platform_frameworks_base/blob/master/core/... > > > and it's assumed that the layout consists of just one TextView at the root. > > >https://github.com/android/platform_frameworks_base/blob/master/core/... > > > So: > > > res/layout/item_simple.xml: > > > <?xml version="1.0" encoding="utf-8"?> > > <TextView .... /> > > > and then: > > > new ArrayAdapter(this, R.layout.item_simple) > > > Constructor #2 takes a layout id and a view id: > > >https://github.com/android/platform_frameworks_base/blob/master/core/... > > > and uses findViewId with the last (third) parameter locate the text > > view within the layout: > > >https://github.com/android/platform_frameworks_base/blob/master/core/... > > > res/layout/item_complex: > > > <?xml version="1.0" encoding="utf-8"?> > > <LinearLayout ... or something else > > > <TextView android:id="@+id/item_text_view .... /> > > <ImageView ... or something else /> > > </LinearLayout> > > > and then > > > new ArrayAdapter(this, R.layout.item_complex, R.id.item_text_view) > > > -- K > > > -- > > 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 -- 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