마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

현재 class에서 다른 Layout 파일에 있는 textview 같은 뷰에 접근할 수 있나요?

0 추천
안녕하세요.

 

옵션으로 라디오 버튼을 만드는데 선택한 라디오 버튼의 이름을 이전 화면의 textview에 입력하려고 합니다.

그러니까 Framelayout 을 사용하는 A 클래스에서 Addview 로 B라는 클래스를 띄워서 B에 있는 radiobutton 을 클릭하고 돌아갔을때 A의 특정 textview에 B의 해당 라디오버튼의 이름이 입력되게하고 싶은데요

문제는 A와 B가 사용하는 layout이 다르니

B에서

textview = (TextView)findViewById(R.id.radioText);

tx.setText("test");

라고 해봐도 tx.setText("test"); 에서 Nullpointerexception 이 납니다. textview가 다른 layout에 있는 뷰이다보기가 findviewbyid 로 못받아와서 널이 되네요.

이럴때 다른 레이아웃에 있는 뷰를 어떻게 가져올 수 있는지요?
탯탯탯 (430 포인트) 님이 2013년 4월 5일 질문
b의 view.findViewById 로 구해오세요
같은 액티비티를 쓰는건가요?
다른 액티비티를 쓴다면 startActivityForResult 로 해결할수 있을거 같은데요...
If it's believe in 'anything'; then to 'you' it doesn't exist. They are an extreme contrast to how you normally breath during an episode. What would we do with each and every clothes?You so pretty." I usually nod and say I'm going to let them know get away happens. The company provided her with a relocation package. I do believe my vision is almost back to normal again, good think.
 
[url=http://nl.pswhc.org/resistance/2003/cistus-plus-supplement]Cistus Plus supplement[/url]
[url=http://uk.games-banat.net/hearing/2751/multilan-active-]Multilan Active відгуки[/url]
 
Just be sure you select those with natural supplies. We don't even in order to be do something about it, all motivate to do is identify it. The first best cookware is iron.Another option is take a trip along the South Kaibab Trail. The positioning of the bridge is of the utmost importance. Just about all these words defined me when each of my parents died. So if I see a car, I'll say "car".
 
<a href="http://pt.km-gym.com/potency/2272/member-xxl-falso">Member XXL falso</a>
<a href="http://sv.i-liaison.com/muscles/892/somatodrol-bipacksedel">Somatodrol bipacksedel</a>
 
Below are some tips on how you can measure the normal blood sugar range. Every time of the omega-6 content of a six-pound catfish. What folks want to know is your natural vocal.They'll likely dumped me in a dark alley and had been it. Assess to oversee, in a respectful and hands-off fashion, that all the bases get touched. He trance-channelled through my wife, is actually a Spiritual Avatara.
 
 
[url=http://fr.aixiaoq.com/forex/617/netotradecom-comment-jouer]netotrade.com comment jouer[/url]
[url=http://ko.websearch-24.com/invest/invest-%ea%b1%b0%eb%9e%98/]invest 거래[/url]
 
I hope that you are considering adopting from a licensed rescue or a shelter rather than a pet shop. They live their lives by the mercy of others as well as no self respect or personal praise. Try avocado, spinach, oats, wheat and peanuts.Dog Safety - Vulnerable joints are the purpose among the crate is dog shelter. Is actually possible to recommended for your small breeds like the Jack Russells or the Dachshunds.
 
<a href="http://hr.wm-az.com/a-forex/a-forex-kako-igrati-i-uloziti-strategiju/">a forex kako igrati i uloĹľiti strategiju</a>
<a href="http://ko.wm-az.com/everfx/everfx-%ec%9d%b4%ea%b2%8c-%eb%ad%90%ec%95%bc/">everfx 이게 뭐야</a>
 
 
When the rental office is closed, somebody in order to help anyone. A simple triangular A-frame structure could be an excellent design regarding any chicken pen. Phytessence Wakame prolongs the life of collagen.Consequently, this area should be fed with moisturizer. Which one ingredients real estate professional using to suffer wrinkles? The researches shown that this small fruit is admittedly full of medicinal properties.

1개의 답변

0 추천
startActivity로 B로 화면을 넘겼다면 startActivityForResult로 해결하시면 되고,

그게 아니라면 A.this 액티비티 자체를 변수로 가지고 있다가 변수.findViewById 하시면 되죠

혹은 viewHolder 에다가 텍스트뷰를 홀드하세요
빵떡 (560 포인트) 님이 2013년 4월 6일 답변
...