Android Studio: viewing horizontal scrolling while testing on emulator

When I test my application (which has a horizontal scroll view) on my emulator, the scrollable part hangs in the middle. Sometimes the scroll freezes when I scroll another path. The application does not freeze, because the "Back" button works. Will this freeze on a real android device, or is it just my emulator responding?

Here is my scroll 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"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="namee.com.myapp.School"
android:background="#000000">

<HorizontalScrollView android:id="@+id/horizontalScroll"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:fadingEdgeLength="20dp"
    android:background="#000000">

   <LinearLayout
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:background="#000000">

       <ImageView android:src="@drawable/sunset3" android:layout_height="354dp" android:layout_width="600dp" />
       <ImageView android:src="@drawable/sunset3" android:layout_height="354dp" android:layout_width="600dp" />
       <ImageView android:src="@drawable/sunset3" android:layout_height="354dp" android:layout_width="600dp" />


       </LinearLayout>

</HorizontalScrollView>

      

Behold the sunset3

http://postimg.org/image/5l69hadel/

+3


source to share


3 answers


I tried this on my Android device (Samsung Galaxy S4 mini, Android 4.4.2) and it works great. It is possible that there is a problem with the emulator (e.g. too low memory).



0


source


For me, disabling the "Use Main GPU" feature solved the freezing issue when scrolling in the emulator.



+3


source


In my case - the vertical scrollbar - this was the API number. The same program runs on two AVDs, both using the host GPU, RAM 512, and a bunch of VM 32s (tried 256 also).

API 21 works, API 19 freezes. Increasing the VM heap didn't solve the problem, but I confirm that shutting down the host GPU (and obviously things get really slow).

+1


source







All Articles