D DevBaby Active Member Licensed User Longtime User Apr 20, 2016 #1 I am calling a library method that requires me to pass the view object for my main layout. Is there a way to get / call the view object for my main layout as I am not using the R.id references the library expects? Code: Copy // Call showOffer with your main activity and main layout view as arguments, to anchor the popup correctly. if(maybeOffer.isPresent()){ wom.showOffer(this, findViewById(R.id.main_layout), maybeOffer.get());} I believe that I may be on the right track with using ba.activity.finViewById(int), but I am not sure what int value to use to reference my main layout view.
I am calling a library method that requires me to pass the view object for my main layout. Is there a way to get / call the view object for my main layout as I am not using the R.id references the library expects? Code: Copy // Call showOffer with your main activity and main layout view as arguments, to anchor the popup correctly. if(maybeOffer.isPresent()){ wom.showOffer(this, findViewById(R.id.main_layout), maybeOffer.get());} I believe that I may be on the right track with using ba.activity.finViewById(int), but I am not sure what int value to use to reference my main layout view.
DonManfred Expert Licensed User Longtime User Apr 20, 2016 #2 findViewById with result in a VIEW to get.... So; you can try to give your layout (panel loaded with designer for example) to your lib (parameter as view) and instead of using findViewById you directly use the view Alternatively you can use XML-Layouts and generate a r file
findViewById with result in a VIEW to get.... So; you can try to give your layout (panel loaded with designer for example) to your lib (parameter as view) and instead of using findViewById you directly use the view Alternatively you can use XML-Layouts and generate a r file
D DevBaby Active Member Licensed User Longtime User Apr 22, 2016 #3 DonManfred said: findViewById with result in a VIEW to get.... So; you can try to give your layout (panel loaded with designer for example) to your lib (parameter as view) and instead of using findViewById you directly use the view Alternatively you can use XML-Layouts and generate a r file Click to expand... Thanks for you help, I will try your idea of passing the view to the library.
DonManfred said: findViewById with result in a VIEW to get.... So; you can try to give your layout (panel loaded with designer for example) to your lib (parameter as view) and instead of using findViewById you directly use the view Alternatively you can use XML-Layouts and generate a r file Click to expand... Thanks for you help, I will try your idea of passing the view to the library.