2

I wrote an android application which has to two views, VideoView above TextView(which is inside a ScrollView), I met a problem that until the VideoView starts playing a video, the TextView is not displayed and I have a blackscreen, and this might take a long time, since the command to start the video is received from a client via RPC. Could someone please help pointing the problem, either by editing main.xml or using code?

My main.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">
<VideoView
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/videoview"
/>
<ScrollView   
    android:id="@+id/ScrollView01"  
    android:layout_height="fill_parent"   
    android:layout_width="fill_parent">
<TextView 
    android:layout_width="wrap_content" 
    android:id="@+id/textview" 
    android:layout_height="wrap_content" 
    android:text="Wellcome"
/>
</ScrollView>
</LinearLayout>

And the import in my activity is only:

setContentView(R.layout.main);
Daniel Nugent
  • 43,104
  • 15
  • 109
  • 137
MByD
  • 135,866
  • 28
  • 264
  • 277
  • Why not? :). I want to print a log to the device's screen. There is relevant activity even when the video is not being played. – MByD Mar 17 '11 at 10:40

1 Answers1

2

i don't think u will have problem in using relative layout like this

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">
<VideoView
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:id="@+id/videoview"
    android:layout_above="@+id/ScrollView01"
/>
<ScrollView   
    android:id="@+id/ScrollView01"  
    android:layout_height="wrap_content"   
    android:layout_width="fill_parent"
    android:layout_gravity="bottom"
    android:layout_alignParentBottom="true"
    >
<TextView 
    android:layout_width="wrap_content" 
    android:id="@+id/textview" 
    android:layout_height="wrap_content" 
    android:text="Wellcome"
/>
</ScrollView>
</RelativeLayout>
Sunil Pandey
  • 7,042
  • 7
  • 35
  • 48
  • Well, that's much better, but: if I set `ScrollView` `android:layout_height="wrap_content"` the text won't scroll. any idea why? – MByD Mar 17 '11 at 14:05
  • see this question http://stackoverflow.com/questions/1748977/making-textview-scrollable-in-android – Sunil Pandey Mar 17 '11 at 14:44