I am changing from blank activity to tabbed activity. I want to recreate view at certain points. I have tried notifyDataSetChanged
and
getFragmentManager().beginTransaction().replace (R.id.container, PlaceholderFragment.newInstance(1)).commit();
But they didn't work. How can I recreate tab?
Also, one small question, while copy/paste during changing activity I need to copy onStart to onStart of fragment and onStop to onDestroyView. Right?
EDit 1:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e0e0e0"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="lcukerd.com.stocknotifier.MainActivity"
tools:showIn="@layout/activity_main">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="120dp"
android:id="@+id/stock_linear"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:id="@+id/value_linear"
android:layout_width="90dp"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:id="@+id/reqd_value_linear"
android:layout_width="90dp"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:id="@+id/check_linear"
android:layout_width="80dp"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
I am populating them with textview dynamically. I have 3 tabs all have same structure. I hope this will do.