Patrick wrote:
> Hallo!
> 
> I have a question concerning views, Activities and how they are
> related.
> 
> I have a TabActivity. Within this activity (in the onCreate method) I
> create a TabHost and a TabSpec and do a
> tabSpectSearch.setContent(intenSearch); The Indent is created using
> intentSearch = new Intent().setClass(this, MyActivity.class);
> Now the MyActivity contains a Button on which I add a onClickListener.
> This has the method public void onClick(View view).
> 
> My question is: from this passed view, is there a way, to get the main
> activity containing the tabs? Or how do I get this object?

My preferred answer for this is: don't use activities for the contents
of tabs. Use regular Views:

http://github.com/commonsguy/cw-android/tree/master/Fancy/Tab/
http://github.com/commonsguy/cw-andtutorials/tree/master/06-Tabs/

Then, there is only one Activity, and you have no problems accessing it.

If you insist on using activities as the contents of tabs, getParent()
from the individual tab's Activity should work, AFAIK.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Consulting: http://commonsware.com/consulting

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to