Here I have my TabLayout, which holds all my activities.:
public class TabLayout extends TabActivity implements
TabContentFactory{
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
tabHost = getTabHost();
Intent i1 = new Intent(this,
Activity1.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Intent i2 = new Intent(this,
Activity2.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator("Activity1").setContent(i1));
tabHost.addTab(tabHost.newTabSpec("tab2").setIndicator("Activity2").setContent(i2));
}
}
Activity1 which needs to have portrait-orientation, looks just like a
normal activity:
public class Activity1 extends ActivityGroup{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(this.getRequestedOrientation() !=
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
setContentView(R.layout.view1);
}
}
Activity2 whould be the camera-app, which needs to have landscape
mode:
public class Activity2 extends ActivityGroup{
public void onCreate(Bundle icicle){
try{
super.onCreate(icicle);
if(this.getRequestedOrientation() !=
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
this.getWindow();
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.camera_surface);
mSurfaceHolder = mSurfaceView.getHolder();
mSurfaceHolder.addCallback(this);
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}catch(Exception e)
e.printStackTrace();
}
}
I am getting more and more desperate, so I really appreciate any
working solution.
Cheers
On Aug 2, 11:55 am, Sarwar Erfan <[email protected]> wrote:
> On Aug 2, 2:11 pm, Robert <[email protected]> wrote:
>
> > Thank you so much for your effort. But unfortunatelly that isnt
> > working with my code. Maybe that's because I am running my activities
> > in Tabs or one of my activity is the camera.
>
> Can you share the skeleton of your code? My suggestion was based to
> two individual Activities, but your situation is not the same. Need to
> know how exactly you have made the arrangements.
>
> Regards
> Sarwar Erfan
--
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