mercredi 6 mai 2015

Access Layout from another Layouts child android

I have an activity with a RelativeLayout, this layout contains two ScrollViews both containing one layout each(for me this in a homemade Flowlayout but for the the sake of simplicity lets say these are LinearLayouts). So the basics of it should be:

<RelativeLayout

   <ScrollView
       <LinearLayout>      //linearlayout number 1
           Child>          //The child i want to access

   <ScrollView
       <LinearLayout>>>    //LinearLayout number 2 (the View I want to update)

In one of the Linearlayouts(number 1) i have children of a type that extends Checkbox(StudyTask for me). In this class (StudyTask) I have an OnClickLIstener and when i call this (click the checkbox) i want to update the information in the other LinearLayout(number 2).

Is this possible or do I have to find another way to do this?

I know that i could put an onclicklistener when I create the Object but since I'm doing it in several places I would like to have the onclicklistener in the StudyTask Class itself.

Aucun commentaire:

Enregistrer un commentaire