make fullScreenVideoView - android

I am creating my custom video player in android. I need requirement that when device is in portrait mode the height of VideoView is half of the screen and when i rotate device in landscape mode it should be fullScreen mode. But I cant not achieve this functionality
below is my xml code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="dp.com.player.MainActivity">
<RelativeLayout
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="#dimen/_200sdp"
android:id="#+id/video_frame">
<VideoView
android:id="#+id/videoView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true" />
<ImageView
android:id="#+id/pause"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:src="#drawable/ic_pause"
android:layout_centerInParent="true"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#CC000000"
android:orientation="vertical"
android:id="#+id/layout_controller"
android:layout_alignParentBottom="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingTop="4dip"
android:orientation="horizontal">
<TextView android:id="#+id/time_current"
android:textSize="14sp"
android:textStyle="bold"
android:paddingTop="4dip"
android:paddingLeft="4dip"
android:layout_gravity="center_horizontal|center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dip"
android:textColor="#android:color/white"/>
<SeekBar
android:id="#+id/sick_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="32dip" />
<TextView android:id="#+id/total_duration"
android:textSize="14sp"
android:textStyle="bold"
android:paddingTop="4dip"
android:paddingRight="4dip"
android:layout_gravity="center_horizontal|center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="4dip"
android:textColor="#android:color/white"/>
<ImageView
android:id="#+id/full_screenMode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_fullscreen_white_24dp"
android:paddingTop="4dip"
android:paddingRight="4dip"
android:layout_gravity="center_horizontal|center_vertical"
android:paddingLeft="4dip"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_below="#+id/video_frame"
android:id="#+id/other_view">
</LinearLayout>
</RelativeLayout>
and below is my activity code
public class MainActivity extends AppCompatActivity {
private int brightnessValue;
ContentResolver contentResolver;
Window window;
VideoView videoView;
private String url = "http://aklearningsolutions.com/video/Nursery Rhymes.mp4";
SeekBar seekBar;
TextView maxTime,currentTime;
long totalDuration;
MediaPlayer mp;
Handler mHandler = new Handler();
LinearLayout mediaController;
RelativeLayout frameLayout;
ImageView pause,fullScreenImage;
boolean isFullscreen;
LinearLayout otherView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initialisedObject();
playVideo();
private void playVideo() {
Uri uri=Uri.parse(url.replace(" ","%20"));
videoView.setVideoURI(uri);
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
#Override
public void onPrepared(MediaPlayer mp) {
updateControllerWidget(mp);
videoView.start();
}
});
}
private void initialisedObject() {
seekBar = (SeekBar)findViewById(R.id.sick_bar);
maxTime = (TextView)findViewById(R.id.total_duration);
videoView = (VideoView)findViewById(R.id.videoView);
currentTime = (TextView)findViewById(R.id.time_current);
mediaController = (LinearLayout)findViewById(R.id.layout_controller);
frameLayout = (RelativeLayout) findViewById(R.id.video_frame);
pause = (ImageView)findViewById(R.id.pause);
fullScreenImage = (ImageView)findViewById(R.id.full_screenMode);
otherView = (LinearLayout)findViewById(R.id.other_view);
}
public void fullScreenVideo(){
otherView.setVisibility(View.GONE);
frameLayout.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,RelativeLayout.LayoutParams.MATCH_PARENT));
fullScreenImage.setImageResource(R.drawable.ic_fullscreen_exit_white_24dp);
isFullscreen = true;
hideController(isFullscreen);
}
public void exitFullscreenVideo(){
fullScreenImage.setImageResource(R.drawable.ic_fullscreen_white_24dp);
isFullscreen = false;
frameLayout.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,RelativeLayout.LayoutParams.WRAP_CONTENT));
}
#Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if(newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
exitFullscreenVideo();
}else if(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE){
fullScreenVideo();
}
}
}

As I understand you want the layout to be full screen in landscape mode, if so
Create a new Layout for landscape mode in layout-land folder
Hide the ActionBar if you need to and then make the VideoView match_parent height and width wise in layout-land.
something like that
<VideoView
android:id="#+id/video"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
UPDATE:
This is not perfect, just a sample to show you how you can save the video position and then resume from there
private VideoView myVideoView;
private int position = 0;
//THEN OVERRIDE THESE TWO METHODS TO SAVE THE VIDEOVIEW Position BEFORE ACTIVITY GETS RECREATED
#Override
public void onSaveInstanceState(Bundle savedInstanceState) {
super.onSaveInstanceState(savedInstanceState);
//HERE WE ARE SAVING VideoView SATATE
savedInstanceState.putInt("Position", myVideoView.getCurrentPosition());
myVideoView.pause();
}
#Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
//HERE WE GETTING THE Position BEFORE VIDEOVIEW WAS DESTROYED
position = savedInstanceState.getInt("Position");
myVideoView.seekTo(position);
}

You should create one more layout in layout-land directory for landscape view
Then in the new layout (landscape layout)
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"// change height to match_parent
android:orientation="vertical" >
<VideoView android:id="#+id/video"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
/>
</RelativeLayout>
If you don't want your layout recreate when rotate to landcapse, you should:
+ Detect orientation change by onConfigurationChanged method
+ Check if orientation is portrait-> change the height of RelativeLayout = 200 programmatically
+ orientation landscape -> change RelativeLayout = MATCH_PARENT

you mention android:layout_height="#dimen/_200sdp" so obviously it does not come in full screen
Create layout-land folder and put below code with same file name and same id
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<VideoView android:id="#+id/video"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
/>
</RelativeLayout>

May be becozz you have fixed your Relative Layout height
<RelativeLayout
android:layout_alignParentTop="true"
android:layout_width="match_parent"
==> android:layout_height="#dimen/_200sdp" <== here
android:id="#+id/video_frame">
make it match_parent and in videoview wrap_content
and add this Flag in your Activity
// full screen
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
and if you want to hide the SystemUI bottom NavigationBar then use this.,
// Set the IMMERSIVE flag.
// Set the content to appear under the system bars so that the content
// doesn't resize when the system bars hide and show.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
getWindow().getDecorView().setSystemUiVisibility(uiOptions);

Related

not able to change the orientation in a desired manner

i am changing my app to landscape on the click of a button but the problem is i have a list view and video view of a fixed height in portrait mode and after changing to landscape mode i only want to show the video view but videoview is shown of that height but i want to show it as full screen.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:id="#+id/relative2">
<VideoView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:visibility="visible"
android:id="#+id/video"
/>
<ProgressBar
android:id="#+id/progressbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="invisible" />
<ImageView
android:id="#+id/full"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="5dp"
android:layout_marginRight="10dp"
android:src="#drawable/ic_fullscreen"
android:visibility="visible"/>
<ImageView
android:id="#+id/potrait"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="5dp"
android:layout_marginRight="10dp"
android:src="#drawable/ic_normal_screen"
android:visibility="invisible"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/relative2">
<ListView
android:id="#+id/play_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="#color/material_blue_grey_800"
android:dividerHeight="1dp"
android:footerDividersEnabled="false"
android:visibility="visible"/>
</RelativeLayout>
and code for changing the orientation:
full.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
defaultScreenOrientationMode = getResources().getConfiguration().orientation;
defaultVideoViewParams = (RelativeLayout.LayoutParams) videoview.getLayoutParams();
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
full.setVisibility(view.GONE);
potrait.setVisibility(view.VISIBLE);
play_list.setVisibility(View.GONE);
videoview.postDelayed(new Runnable() {
#Override
public void run() {
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.MATCH_PARENT);
// mc.show(0);
}
}, 700);
}
});
potrait.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
int defaultScreenOrientationMode;
potrait.setVisibility(view.INVISIBLE);
full.setVisibility(view.VISIBLE);
play_list.setVisibility(view.VISIBLE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
videoview.postDelayed(new Runnable() {
#Override
public void run() {
videoview.setLayoutParams(defaultVideoViewParams);
videoview.layout(10, 10, 10, 10);
// mc.show(0);
}
}, 700);
}
});
To stop reloading activity on orientation change, write below code in manifest
<activity
android:name=".YourActivityName"
android:configChanges="orientation|screenSize">
</activity>
LinearLayout layout = /* ... */;
layout.setOrientation(LinearLayout.VERTICAL);

how to set visibility for imagepager and linear layout

i have this pager in the layout and i tried to setVisibility for the pager and the linear layout based on condition , but its not working i search in the internet and all have the same answer, any idea ?
this is the xml
<LinearLayout
android:orientation="vertical"
android:id="#+id/error_linear_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1"
android:visibility="visible">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="#mipmap/ic_launcher"
android:id="#+id/error_image_view"
android:layout_weight="0.59" />
<TextView
android:text="This Screen Is Not Active"
android:textSize="30sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/error_text_view"
android:layout_weight="0.59" />
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible"></android.support.v4.view.ViewPager>
and this is the main activity
ViewPager imagePager;
LinearLayout errorLayout;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image_pager);
//views
errorLayout = (LinearLayout) findViewById(R.id.error_linear_layout);
imagePager = (ViewPager) findViewById(R.id.pager);
IsActive();
}
public void IsActive()
{
String x = "x";
if (x=="x")
{
imagePager.setVisibility(View.VISIBLE);
errorLayout.setVisibility(View.INVISIBLE);
}else
{
imagePager.setVisibility(View.INVISIBLE);
errorLayout.setVisibility(View.VISIBLE);
}
}
Maybe the error isnt that the view isnt INVISIBLE, but that:
x can never equal "x". variable X is a reference, not the actual representation of it.
Use:
if(x.equals("x")) instead.

Animating when re-positioning a view

As you can see in the attached code, linearLayoutLogo contains a ProgressBar and TextView and linearLayoutReading contains an ImageView and TextView. When linearLayoutReading is made visible the the two layouts reposition themselves around the center point due to android:layout_centerInParent="true".
How can I animate linearLayoutLogo so it shifts upwards to its new position prior to linearLayoutReading becoming visible? Please see the attached video for an example.
activity_main.xml
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_centerInParent="true"
android:gravity="center">
<LinearLayout
android:id="#+id/linearLayoutLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center">
<ImageView
android:id="#+id/imageViewRLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_accessibility_black_24dp"
android:padding="8dp"/>
<TextView
android:id="#+id/textViewAppTitle2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="34sp"
android:textColor="#CCFFFFFF"
android:text="AppName"/>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayoutReading"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="24dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="#style/Base.TextAppearance.AppCompat.Large"
android:text="Reading from device"
android:textColor="#BF000000" />
<ProgressBar
android:id="#+id/progressBarSplash"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
style="#style/Base.Widget.AppCompat.ProgressBar.Horizontal"
android:paddingBottom="8dp"/>
</LinearLayout>
</LinearLayout>
MainActivity.java
public class MainActivity extends AppCompatActivity {
public ProgressBar progressBarSplash;
public LinearLayout linearLayoutReading;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
linearLayoutReading = (LinearLayout)findViewById(R.id.linearLayoutReading);
linearLayoutReading.setVisibility(View.GONE);
new CountDownTimer(5000, 1000) {
public void onTick(long millisUntilFinished) {
}
public void onFinish() {
linearLayoutReading.setVisibility(View.VISIBLE);
progressBarSplash = (ProgressBar)findViewById(R.id.progressBarSplash);
progressBarSplash.setEnabled(true);
progressBarSplash.setIndeterminate(true);
}
}.start();
}
}
Tested it out on Android Studio. Just include android:animateLayoutChanges="true" in the top most LinearLayout (the one with centerInParent element).

Zbar Camera not taking full screen

I want to put a customise layout to scan bar code using Zbar.
The problem:
As you can see the camera is not taking the entire frame layout.It is taking the width,but not the height.Why this is happening??
Code:
qrscannerzbarlayout.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="#+id/zbar_layout_area"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello"
/>
</LinearLayout>
<FrameLayout
android:id="#+id/frmQr"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#+id/ll_footerx"
android:layout_below="#+id/zbar_layout_area"
android:layout_centerHorizontal="true" >
</FrameLayout>
<RelativeLayout
android:id="#+id/ll_footerx"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_alignParentBottom="true"
android:layout_marginBottom="5dp" >
<TextView
android:id="#+id/tv_line123"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="Place barcode in screen view and hold steady"
android:textSize="14sp"
android:textStyle="bold" />
<Button
android:id="#+id/button_back"
android:layout_width="100dp"
android:layout_height="48dp"
android:layout_alignParentLeft="true"
android:layout_below="#id/tv_line123"
android:layout_marginLeft="40dp"
android:layout_marginTop="15dp"
android:background="#drawable/trailsky"
android:text="WONT SCAN" />
<Button
android:id="#+id/button_nobarcode"
android:layout_width="100dp"
android:layout_height="48dp"
android:layout_alignParentRight="true"
android:layout_below="#id/tv_line123"
android:layout_marginRight="40dp"
android:layout_marginTop="15dp"
android:background="#drawable/passyellow"
android:text="NO BARCODE" />
</RelativeLayout>
</RelativeLayout>
The linear layout is used to place a header,frame layout to put the camera preview and the relative layout to put the footer.
Here is the java code:(I am just copying a part of it)
public class ZBarScannerActivity extends Activity implements Camera.PreviewCallback, ZBarConstants{
Button btnnobarcode;
#SuppressWarnings("unused")
private static final String TAG = "ZBarScannerActivity";
private CameraPreview mPreview;
private Camera mCamera;
private ImageScanner mScanner;
private Handler mAutoFocusHandler;
private boolean mPreviewing = true;
static {
System.loadLibrary("iconv");
}
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
if(!isCameraAvailable()) {
// Cancel request if there is no rear-facing camera.
cancelRequest();
return;
}
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.qrscannerzbar_layout);
btnnobarcode=(Button)findViewById(R.id.button_nobarcode);
btnnobarcode.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent i = new Intent(ZBarScannerActivity.this,AddCardDetails.class);
i.putExtra("result","");
startActivity(i);
finish();
}
});
mAutoFocusHandler = new Handler();
// Create and configure the ImageScanner;
setupScanner();
// Create a RelativeLayout container that will hold a SurfaceView,
// and set it as the content of our activity.
mPreview = new CameraPreview(this, this, autoFocusCB);
//setContentView(mPreview);
FrameLayout zbarLayout = ( FrameLayout) findViewById(R.id.frmQr);
mPreview.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
zbarLayout.addView(mPreview);
}

changing the layout properties on configuration change causes the view to be distorted

this is my xml file:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="#+id/videoactivity"
>
<FrameLayout android:id="#+id/videoContainer"
android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_weight="4"
android:background="#ffffff"
>
<com.schoolinsites.MediaPlayer.VideoView
android:id="#+id/videoView" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_gravity="center">
</com.schoolinsites.MediaPlayer.VideoView>
<ProgressBar
android:id="#+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="invisible"
/>
<com.schoolinsites.viewgroup.AdvertisementsView
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="bottom"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:id="#+id/advertisementcontrol"
></com.schoolinsites.viewgroup.AdvertisementsView>
</FrameLayout>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/list_cardId"
android:layout_marginTop="2dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:background="#drawable/card_background"
android:layout_weight="2"
/>
</LinearLayout>
when i change the orientation of the screen, i am changing the layout properties by using the below code but the videoview is distorted after orientation change.
#Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if(IsFullscreen)
{
}
else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE)
{
mVideo.pause();
mVideo.setBackgroundColor(R.drawable.action_search);
LinearLayout layout = (LinearLayout)findViewById(R.id.videoactivity);
layout.setOrientation(LinearLayout.HORIZONTAL);
FrameLayout bottomFrameLayout = (FrameLayout)findViewById(R.id.videoContainer);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT,1);
lp.bottomMargin = 100;
bottomFrameLayout.setLayoutParams(lp);
mVideo.start();
}
else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT)
{
mVideo.pause();
LinearLayout layout = (LinearLayout)findViewById(R.id.videoactivity);
layout.setOrientation(LinearLayout.VERTICAL);
FrameLayout bottomFrameLayout = (FrameLayout)findViewById(R.id.videoContainer);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT,4);
bottomFrameLayout.setLayoutParams(lp);
mVideo.start();
}
}
how to change the orientation without distorting the videoview. can any one please help me in solving the problem.
i thing's this realy if your work on 3.0+ android, in AndroidMainfest, in your activity add, android:configChanges="screenSize"

Categories

Resources