[android-developers] Re: Activity inside a view

2010-09-06 Thread a1
 Does anyone has a simple example of to use LocalActivityManager or
 something else to meet my requirements.

void createInnerActivity(ViewGroup container, Class? activityClass)
{
if (container.getChildCount() != 0) {
container.removeViewAt(0);
}

final Intent intent = new Intent(this, activityClass);
final Window window =
getLocalActivityManager().startActivity(activityClass.toString(),
intent);
container.addView(window.getDecorView(), new
ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT));
}

Above should be a method of activity that extends ActivityGroup,
passed container will host newly created activity.

--
Bart Janusz

-- 
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


[android-developers] Re: Activity inside a view

2010-09-06 Thread Explore Android
Thanks a lot. That solves my problem.

On Sep 6, 6:49 pm, a1 arco...@gmail.com wrote:
  Does anyone has a simple example of to use LocalActivityManager or
  something else to meet my requirements.

 void createInnerActivity(ViewGroup container, Class? activityClass)
 {
         if (container.getChildCount() != 0) {
             container.removeViewAt(0);
         }

         final Intent intent = new Intent(this, activityClass);
         final Window window =
 getLocalActivityManager().startActivity(activityClass.toString(),
 intent);
         container.addView(window.getDecorView(), new
 ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
                 ViewGroup.LayoutParams.FILL_PARENT));

 }

 Above should be a method of activity that extends ActivityGroup,
 passed container will host newly created activity.

 --
 Bart Janusz

-- 
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


[android-developers] Re: Activity inside a view

2010-09-05 Thread a1
 Because you can't put an Activity inside a View - that's simply not
 supported and makes no sense.

You can and moreover it makes a lot of sense, TabHost in fact relies
on this.


  see:
  developer.android.com/reference/android/app/LocalActivityManager.html

 And ... ?

Subclass ActivityGroup, get LocalActivityManger, create local activity
and add decor view from newly created activity window as child of any
of ViewGroup in your layout, as simple as that.

--
Bart Janusz

-- 
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


[android-developers] Re: Activity inside a view

2010-09-05 Thread skink


On Sep 5, 1:40 pm, a1 arco...@gmail.com wrote:
  And ... ?

 Subclass ActivityGroup, get LocalActivityManger, create local activity
 and add decor view from newly created activity window as child of any
 of ViewGroup in your layout, as simple as that.


I didn't test it but in theory you don't even need ActivityGroup - you
can use it in any Activity since there is a ctor
LocalActivityManger(Activity parent)

pskink

-- 
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


Re: [android-developers] Re: Activity inside a view

2010-09-05 Thread TreKing
On Sun, Sep 5, 2010 at 6:40 AM, a1 arco...@gmail.com wrote:

 You can and moreover it makes a lot of sense, TabHost in fact relies on
 this.


This is true, though I'm not sure if this is what the OP is getting at. But
I may very well be misunderstanding the OP's request to have an Acitvity
inside a View.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
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

[android-developers] Re: Activity inside a view

2010-09-05 Thread Explore Android
Thanks for all your feedback or suggestions.

Before posting this message I was already implementing the solution
that proposed by TreKing.
But I felt this is not a smart way of doing it. It would have been
nicer to have all my ActivityA behavior and GUI (with out any
modifications)
showed inside a frame layout of ActivityB.

I know TabHost does this but could not understand it's implementation
fully. So is the reason for posting this issue.

Does anyone has a simple example of to use LocalActivityManager or
something else to meet my requirements.

Thanks

On Sep 6, 7:14 am, TreKing treking...@gmail.com wrote:
 On Sun, Sep 5, 2010 at 6:40 AM, a1 arco...@gmail.com wrote:
  You can and moreover it makes a lot of sense, TabHost in fact relies on
  this.

 This is true, though I'm not sure if this is what the OP is getting at. But
 I may very well be misunderstanding the OP's request to have an Acitvity
 inside a View.

 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
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


[android-developers] Re: Activity inside a view

2010-09-04 Thread viktor
You can use one activity and few views, and manage only their
visibility, except if you have to use different view containers
(MapView, ListView, ...).



On 3 Вер, 23:04, Kumar Bibek coomar@gmail.com wrote:
 Yeah, you can use the LocalActivityManager, but for his situation, I
 guess the best way would be to follow Treking's advice. I haven't
 really dived into the LocalActivityManager however. I don't know how
 easy or difficult that would be.

 -Kumar Bibekhttp://techdroid.kbeanie.com

 On Sep 3, 11:13 pm, skink psk...@gmail.com wrote:



  TreKing wrote:
   On Thu, Sep 2, 2010 at 11:39 PM, Explore Android
   stetest...@googlemail.comwrote:

Starting ActivityA in full screen mode is straight forward but I want 
this
activity to be with in the framelayout of ActivityB.

   That's not possible.

  why not?

  see:
  developer.android.com/reference/android/app/LocalActivityManager.html

  pskink

-- 
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


[android-developers] Re: Activity inside a view

2010-09-03 Thread Kumar Bibek
Yeah, you can use the LocalActivityManager, but for his situation, I
guess the best way would be to follow Treking's advice. I haven't
really dived into the LocalActivityManager however. I don't know how
easy or difficult that would be.

-Kumar Bibek
http://techdroid.kbeanie.com

On Sep 3, 11:13 pm, skink psk...@gmail.com wrote:
 TreKing wrote:
  On Thu, Sep 2, 2010 at 11:39 PM, Explore Android
  stetest...@googlemail.comwrote:

   Starting ActivityA in full screen mode is straight forward but I want this
   activity to be with in the framelayout of ActivityB.

  That's not possible.

 why not?

 see:
 developer.android.com/reference/android/app/LocalActivityManager.html

 pskink

-- 
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