Hide activity windows

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Hide activity windows

Postby Hebus » Wed Apr 22, 2009 12:29 pm

Hi guys,

I've been searching a lot to find a solution to my problem and I really hope one of you may help.

I have a buch of activities in a application that are calling them selves, waiting for results of their child. These activity are running with a dialog theme.
The problem is that when an activity launch a child activity, the child's windows (dialog box) might be smaller than the parent's one, an dit is not cute at all...

If there any way to the parent activity to hide itself after calling a subActivity, then restore its view when the child returns?

Thanks for the help
Hebus
Junior Developer
Junior Developer
 
Posts: 14
Joined: Wed Apr 15, 2009 1:10 pm

Top

Postby padde » Wed Apr 22, 2009 3:37 pm

Try to set the visability of the actual view to gone and use startActivityForResult instead of startActivity.
When the child activity returns the parents onActivityResult is called.
Cant provide sample code right now but those hints and a bit of searching in the forum here or at google
should do the rest ;)


Greets
Padde
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby Hebus » Wed Apr 22, 2009 5:12 pm

I just tried this with

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. currentView = this.getCurrentFocus();
  2.  
  3.                         currentView.setVisibility(View.GONE);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


and then when receiving the subActivity results :

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. currentView.setVisibility(View.VISIBLE);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


but the window doesn't disapear, only the window content is hidden.

Anyway it's better as the window become almost invisible behind the new activity window.

But if I could hide the full windows it would be far better.
Note that my activity class is extending Activity and not a View class, maybe this can explain why only the content of the window is hidden
Hebus
Junior Developer
Junior Developer
 
Posts: 14
Joined: Wed Apr 15, 2009 1:10 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 11 guests