У меня есть активность в Android TextView, затем снова ListView TextView. Содержимое первого TextView занимает весь экран, и для просмотра ListView и второго TextView пользователь должен прокрутить список. Теперь я хочу показать второй TextView при запуске активности вместо первого TextView.
Вместо этого я хочу, чтобы TextView2 был виден при запуске активности.
EDITED
Пример кода по совету @ Urban
public class FocusTestActivity extends Activity {
private static final String TAG = "FocusTestActivity";
ScrollView scroll;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView text1 = (TextView) findViewById(R.id.text1);
TextView text2 = (TextView) findViewById(R.id.text2);
TextView text3 = (TextView) findViewById(R.id.text3);
String hello = "We provide services to K-12 education sector."
+ "Our services include Feasibility report, Marketing, Curriculum design"
+ "Teachers planning, Design and Technology, Parents expectation"
+ "management, Transport planning, Day-to-day operations and Statutory"
+ "compliances. Please find a brief introduction attached with mail. Also visit"
+ "www.wissenways.com We can help you with overall process of setting-up school. We have"
+ "experience include establishing International, pre-school and CBSE"
+ "schools from scratch. Please feel free to contact if you need some help in your school venture."
+ "Best of Luck!<br/><br/>";
text1.setText(Html.fromHtml(hello));
text2.setText(Html.fromHtml(hello));
text3.setText(Html.fromHtml(hello));
ScrollView scroll = (ScrollView) findViewById(R.id.scrollcontainer);
}
public void onStart() {
super.onStart();
Log.d(TAG,"Inside onStart");
scroll.post(new Runnable() {
@Override
public void run() {
scroll.fullScroll(ScrollView.FOCUS_DOWN);
}
});
}
}
XML-код
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollcontainer"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:textSize="17sp"/>
<TextView
android:id="@+id/text2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:textSize="17sp"/>
<TextView
android:id="@+id/text3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:textSize="17sp"/>
</LinearLayout>
</ScrollView>
LOGCAT выход: