android-orientation

Callback after orientation change becomes null

拥有回忆 提交于 2019-12-10 17:20:29
问题 I have have a FragmentActivity with two tabs which are ListFragment s. Each ListFragment has a callback. An example of a callback The callback is associated inside of the onAttach(...) method OnStatusUpdateListener mStatusUpdateCallback; public interface OnStatusUpdateListener { public void onStatusUpdate(); } @Override public void onAttach(Activity activity) { Log.d(TAG, "onAttach"); super.onAttach(activity); try { mStatusUpdateCallback = (OnStatusUpdateListener)activity; } catch

media player does not load when activity is recreated on orientation change

大兔子大兔子 提交于 2019-12-10 16:54:37
问题 I am new to play a video in video player using surface view now i want to save instance state of media player when orientation change when view reloaded or recreated then old media player state start at old position not to load on original means at zero position i set in manifest like screen orientation but that time oncreate not called i want to call also oncreate method when screen orientation change means to say i want to reload a new activity when orientation change and also save media

How to get android video capture to survive screen rotation

Deadly 提交于 2019-12-10 11:13:27
问题 I have managed to get Video capture to work for a custom camera experience (i.e. using MediaRecorder, Camera, SurfaceView, etc.). But if I am recording a video and change the orientation of the device, video capture stops. Is there way to continue the capture after the orientation change? If fact I want the capture to continue no matter how many times the orientation changes. I imagine it might all have to do with savedInstanceState and saving the file that I pass to mRecorder.setOutputFile

Android webview retain form data when orientation changes

…衆ロ難τιáo~ 提交于 2019-12-10 09:36:10
问题 How to retain the form data in the webview after the change the orientation ? I have used onSaveInstanceState() and I have restored the previous state using restoreState(savedInstanceState) . This successfully restores the previous state before the change in orientation but it does not restore the data in the text box of the form in the webview. What should be done to retain the data in the text box of the forms in webview after the change in orientation ? Note: I would not be using android

How to detect Upside down Orientation in android?

早过忘川 提交于 2019-12-08 20:45:35
问题 In my android app i have panorama image and i am rotating this image according to phones motion using TYPE_ORIENTATION sensor it is working fine for both landscape and potrait. Here is the code for rotation logic. @Override public void onSensorChanged(SensorEvent event) { switch (event.sensor.getType()) { case Sensor.TYPE_ORIENTATION: float[] insideval = getValPoints(); event.values[1]=(float) (event.values[1]*2.8); event.values[2]=(float) (event.values[2]*2.8); setValPoints(event.values

Why is my Orientation Change Going Unnoticed?

一世执手 提交于 2019-12-08 08:01:44
问题 Based on the accepted answer here, I added this code to an Activity as what I hoped to be the first step in changing the assigned Layout for an Activity: @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); // Checks the orientation of the screen if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { Toast.makeText(this, "landscape", Toast.LENGTH_SHORT).show(); setContentView(R.layout.activity_settings_landscape); } else

Manage scroll position in scrollview during orientation change

让人想犯罪 __ 提交于 2019-12-08 04:02:39
问题 I have a Bookshelf which is implemented as follows: I have a ScrollView which contains a nested TableLayout which acts as a container for dynamically generated TableRows. <com.test.bookshelf.CustomScrollView android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/newHeader" android:overScrollMode="never" android:fadingEdge="none" > <TableLayout android:id="@+id/tblLayout" android:layout_width="fill_parent" android:layout

How can I properly control stage orientation on Android with AIR mobile?

微笑、不失礼 提交于 2019-12-07 11:03:57
问题 I have an AIR application that I wish to lock into landscape orientation. I never want the application to rotate to portrait mode. Adobe's solution to this problem, seemingly, would be to configure my *-app.xml file as follows: <!-- The initial aspect ratio of the app when launched (either "portrait" or "landscape"). Optional. Mobile only. Default is the natural orientation of the device --> <aspectRatio>landscape</aspectRatio> <!-- Whether the app will begin auto-orienting on launch.

Retained Fragment Not Retained

这一生的挚爱 提交于 2019-12-07 07:31:10
问题 I have a simple layout containing a VideoView. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/black" android:gravity="center" > <VideoView android:id="@+id/videoPlayer" android:layout_width="fill_parent" android:layout_height="fill_parent"/> </RelativeLayout> The Activity that uses this layout creates a Fragment to start the VideoView public class VideoPlayerActivity

Manage scroll position in scrollview during orientation change

邮差的信 提交于 2019-12-06 16:52:48
I have a Bookshelf which is implemented as follows: I have a ScrollView which contains a nested TableLayout which acts as a container for dynamically generated TableRows. <com.test.bookshelf.CustomScrollView android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/newHeader" android:overScrollMode="never" android:fadingEdge="none" > <TableLayout android:id="@+id/tblLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="0dp" > </TableLayout> </com.test.bookshelf.CustomScrollView>