listview not refreshing in fragment with viewpager tabs - android

I got stuck into the problem with listview used with fragment inside viewpager styled tabs that given in jakewharton's Android-ViewPagerIndicator... example on github.
i am using the same lib for three tabs each having a list view with same arraylist set to there adapters.
I am using 3 this kind of fragment all are working fine but as i want my list to be updated in all other fragments when i make changes in any one of them, it is not reflecting the changes.
i want if i checked a checkbox in any one of the list among three tabs (i am updating values in db and my arraylist) other two listview inside their respective fragments should reflect changes, please help me on this.
please help me on this, any help would be appreciated
class RingFragment extends Fragment
{
public static RingFragment newInstance(Context c, ArrayList<Ringtones> ringList)
{
RingFragment fragment = new RingFragment();
cCntxt = c;
return fragment;
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
savedInstanceState)
{
rngAdapter = new RingAdapter(cCntxt, ringFragList);
lstRingtones = new ListView(cCntxt);
lstRingtones.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
lstRingtones.setAdapter(rngAdapter);
LinearLayout layout = new LinearLayout(getActivity());
layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
layout.setGravity(Gravity.CENTER);
layout.addView(lstRingtones);
return layout;
}
public class RingAdapter extends BaseAdapter
{
ArrayList<Ringtones> arlstRingAdpter;
Context adptrContext;
public boolean noRing = false;
public RingAdapter(Context c, ArrayList<Ringtones> adptrRngtones)
{
arlstRingAdpter = adptrRngtones;
adptrContext = c;
}
#Override
public int getCount()
{
return arlstRingAdpter.size();
}
#Override
public Object getItem(int position)
{
return position;
}
#Override
public long getItemId(int position)
{
return position;
}
#Override
public View getView(int position, View convertView, ViewGroup parent)
{
View view = convertView;
final Wrapper wrapper;
if (view == null)
{
view = (RelativeLayout)LayoutInflater.from(cCntxt).inflate(R.layout.cell_ringtone,
null);
wrapper = new Wrapper(view);
view.setTag(wrapper);
}
else
{
wrapper = (Wrapper) view.getTag();
}
return view;
}
}
}
}
:->My Main Activity from where i am calling these fragments is
public class MainActivity extends FragmentActivity
{
ViewPager mPager;
PageIndicator mIndicator;
MusicAdapter mAdapter;
RingtonesBL rngBL;
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mAdapter = new MusicAdapter(getSupportFragmentManager());
mPager = (ViewPager)findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
mIndicator = (TabPageIndicator)findViewById(R.id.indicator);
mIndicator.setViewPager(mPager);
}
class MusicAdapter extends RingtoneFragmentAdapter
{
public MusicAdapter(FragmentManager fm)
{
super(fm);
}
#Override
public Fragment getItem(int position)
{
if(position % CONTENT.length == 0)
{
return
RingFragment.newInstance(AppConstants.cAppContext,AppConstants.arlst_RingAll);
}
else if(position % CONTENT.length == 1)
{
return RingFragment1.newInstance(AppConstants.cAppContext,
AppConstants.arlst_RingCart);
}
else
{
return RingFragment2.newInstance(AppConstants.cAppContext,
AppConstants.arlst_RingPurchased);
}
}
public int getItemPosition(Object object)
{
return POSITION_NONE;
}
#Override
public int getCount()
{
return CONTENT.length;
}
#Override
public CharSequence getPageTitle(int position)
{
return CONTENT[position % CONTENT.length].toUpperCase();
}
}
}
activity_main.xml having only
<com.ringtone.TabPageIndicator
android:id="#+id/indicator"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
/>
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="#+id/indicator"
>
</android.support.v4.view.ViewPager>
Please tell me how can i notify the other fragments listview while changing in any one.

Please try to do stuff out of this branches:
for example:
else
{
wrapper = (Wrapper) view.getTag();
}
wrapper.txtText.setText("Refreshed");
return view;
}

Related

My ViewPager SetOnItemClickListener Dosen't Work

I have a viewpager in a fragment. My viewpager has 3 tabs, Each tab has a listview. i want to set item click listener for each item of listview to go to another fragment, But I can't setOnItemClickListener for second tab & third tab, Just first tab works. Every SetOnClickListener is correct. Help Me Please!
ViewPager XML
<android.support.v4.view.ViewPager
android:id="#+id/vpPager"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<android.support.v4.view.PagerTabStrip
android:id="#+id/pager_header"
android:layout_width="match_parent"
android:layout_height="36dp"
android:layout_gravity="top"
android:paddingBottom="4dp"
android:textColor="#color/RakaarColor"
android:paddingTop="4dp" />
</android.support.v4.view.ViewPager>
ViewPager Class
public class ProjectsFragment extends Fragment {
MyPagerAdapter adapterViewPager;
public static class MyPagerAdapter extends FragmentPagerAdapter {
private static int NUM_ITEMS = 3;
String[] titles = {"MyWorks", "SentBids", "ExistProject"};
public MyPagerAdapter(FragmentManager fragmentManager) {
super(fragmentManager);
}
// Returns total number of pages
#Override
public int getCount() {
return NUM_ITEMS;
}
// Returns the fragment to display for that page
#Override
public Fragment getItem(int position) {
switch (position) {
case 0: // Fragment # 0 - This will show FirstFragment
return MyWorksFragment.newInstance(0);
case 1: // Fragment # 0 - This will show FirstFragment different title
return SentBidsFragment.newInstance(1);
case 2: // Fragment # 1 - This will show SecondFragment
return ExistProjectsFragment.newInstance(2);
default:
return null;
}
}
// Returns the page title for the top indicator
#Override
public CharSequence getPageTitle(int position) {
return titles[position];
}
}
public ProjectsFragment() {
// Required empty public constructor
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_projects, container, false);
ViewPager vpPager = (ViewPager) view.findViewById(R.id.vpPager);
adapterViewPager = new MyPagerAdapter(getChildFragmentManager());
vpPager.setAdapter(adapterViewPager);
vpPager.setOffscreenPageLimit(0);
vpPager.setCurrentItem(3);
PagerTabStrip pagerTabStrip = (PagerTabStrip) view.findViewById(R.id.pager_header);
pagerTabStrip.setDrawFullUnderline(true);
pagerTabStrip.setTabIndicatorColor(Color.parseColor("#44b1c5"));
Typeface IRANSansFaNum = Typeface.createFromAsset(getActivity().getAssets(), "fonts/IRANSansMobile.TTF");
for (int i = 0; i < pagerTabStrip.getChildCount(); ++i) {
View nextChild = pagerTabStrip.getChildAt(i);
if (nextChild instanceof TextView) {
TextView textViewToConvert = (TextView) nextChild;
textViewToConvert.setTypeface(IRANSansFaNum);
}
}
Button plus = (Button)view.findViewById(R.id.projects_plus_button);
plus.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
AddFragment Add = new AddFragment();
FragmentManager manager = getActivity().getSupportFragmentManager();
manager.beginTransaction().replace(R.id.mycontainer, Add).addToBackStack("Back").commit();
}
});
return view;
}
One Example Of My Adapters
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_exist_projects, container, false);
ProjectsAdapter madapter;
plistnewsData.clear();
ListView exist_projects_listview = (ListView)view.findViewById(R.id.exist_projects_listview);
plistnewsData.add(new ProjectsAdapterItems("Name", "Details", "Cost", "Day", "Date", "120 Bids"));
madapter = new ProjectsAdapter(plistnewsData);
exist_projects_listview.setAdapter(madapter);
exist_projects_listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
#Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
ProjectsItemsFragment Add = new ProjectsItemsFragment();
FragmentManager manager = getActivity().getSupportFragmentManager();
manager.beginTransaction().replace(R.id.mycontainer, Add).addToBackStack("Back").commit();
SharedPreferences pos = getActivity().getSharedPreferences("position", Context.MODE_PRIVATE);
SharedPreferences.Editor posEdit = pos.edit();
posEdit.putString("position", "" + position);
posEdit.commit();
}
});
return view;
}
private class ProjectsAdapter extends BaseAdapter {
public ArrayList<ProjectsAdapterItems> plistnewsDataAdpater ;
public ProjectsAdapter(ArrayList<ProjectsAdapterItems> plistnewsDataAdpater) {
this.plistnewsDataAdpater=plistnewsDataAdpater;
}
#Override
public int getCount() {
return plistnewsDataAdpater.size();
}
#Override
public String getItem(int position) {
return null;
}
#Override
public long getItemId(int position) {
return position;
}
#Override
public View getView(int position, View convertView, ViewGroup parent)
{
LayoutInflater mInflater = getActivity().getLayoutInflater();
View myView = mInflater.inflate(R.layout.title_of_firstlistview, null);
final ProjectsAdapterItems p = plistnewsDataAdpater.get(position);
TextView name = (TextView)myView.findViewById(R.id.projects_name);
name.setText(p.pname);
TextView details = (TextView)myView.findViewById(R.id.projects_details);
details.setText(p.pdetails);
TextView cost = (TextView)myView.findViewById(R.id.projects_cost);
cost.setText(p.pcost);
TextView day = (TextView)myView.findViewById(R.id.projects_day);
day.setText(p.day);
TextView date = (TextView)myView.findViewById(R.id.projects_date);
date.setText(p.date);
TextView bids = (TextView)myView.findViewById(R.id.project_propsal);
bids.setText(p.bids);
return myView;
}
}
}

Lost reference of Fragments in FragmentPagerAdapter

I have a simple FragmentPagerAdapter :
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
pagerAdapterList = new ArrayList<>();
super(fm);
}
#Override
public Fragment getItem(int position) {
PagerAdapter fragment;
if (position > pagerAdapterList.size() - 1) {
fragment = new PagerAdapter(followRequests.get(position));
pagerAdapterList.add(fragment);
} else
return pagerAdapterList.get(position);
return fragment;
}
public int removeView (ViewPager pager, int position)
{
pager.setAdapter (null);
pagerAdapterList.remove (position);
data.remove (position);
pager.setAdapter (this);
return position;
}
#Override
public Object instantiateItem(ViewGroup container, int position) {
getItem(position);
return super.instantiateItem(container, position);
}
#Override
public int getCount() {
return data.size();
}
}
and PagerAdapter class:
public class PagerAdapter extends Fragment {
Data data;
private View overlayView;
public PagerAdapter() {
}
public PagerAdapter(Data data) {
this.data= data;
}
#Nullable
#Override
public View onCreateView(LayoutInflater inflater, #Nullable ViewGroup container, #Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.notification_header_fragment_pager, container, false);
TextView id_txtView = (TextView)
overlayView = (View) rootView.findViewById(R.id.viewOverlay);
//bind some data for example id_txtView.setText(data.getText());
return rootView;
}
public void showOverlayView() {
if(overlayView != null)
overlayView.setVisibility(View.VISIBLE);
}
}
first I call
removeView(mViewPager, position);
then I get new data, and then call
adapter.notifyDataSetChanged();
All things work fine and I can bind new data in PagerAdapter and show it on View Pager.
But when I call
((PagerAdapter) adapter.getItem(mViewPager.getCurrentItem())).showOverlayView();
I get current fragment without any reference to its ui components(like overlayView) and they are null !!
what's my wrong?
Please help me, Thanks.

Android saving dynamically added viewpager's fragment while coming back from another activity and reopening app

With the help of answer of the this question in StackOverflow(Remove Fragment Page from ViewPager in Android), I successfully created my project and did some modifications according to my needs.
I am able to add N number of fragments(viewpages) in my main layout and delete them until page count becomes zero.
Now, I struck with an issue.i.e. ones, if I move from my current activity which is holding this pages to other activity or if I close my app and come back,I am only able to see initial statically added fragment.
I would like to see not only initial page but also previously added pages. Should i use SharedPreferences to store dynamically added fragments?
Here is my source code:
My main layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="900dp"
/>
<Button
android:id="#+id/show_items"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_marginTop="200dp"
android:textColor="#ffffff"
android:background="#49a942"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:text="+" />
<Button
android:id="#+id/grid_apps_show"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/pager"
android:layout_alignParentBottom="true"
android:text="Apps"
/>
</RelativeLayout>
My MainActivity class:
public class MainActivity extends FragmentActivity implements TextProvider{
Button home;
private ViewPager mPager;
private MyPagerAdapter mAdapter;
private ArrayList<String> mEntries = new ArrayList<String>();
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
home = (Button) findViewById(R.id.show_items);
mEntries.add("pos 1");
mPager = (ViewPager) findViewById(R.id.pager);
home.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
MainActivity.this);
alertDialogBuilder.setTitle("Add/Delete Screens");
alertDialogBuilder
.setCancelable(false)
.setNegativeButton("+",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
addNewItem();
}
})
.setPositiveButton("-",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
removeCurrentItem();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
});
mAdapter = new MyPagerAdapter(this.getSupportFragmentManager(), this);
mPager.setAdapter(mAdapter);
}
private void addNewItem() {
mEntries.add("Pages");
mAdapter.notifyDataSetChanged();
}
private void removeCurrentItem() {
int position = mPager.getCurrentItem();
if(position != 0){
mEntries.remove(position);
mAdapter.notifyDataSetChanged();
}
else{
Toast.makeText(getApplicationContext(), "Minimum Screens are one!", Toast.LENGTH_LONG).show();
}
}
#Override
public String getTextForPosition(int position) {
return mEntries.get(position);
}
#Override
public int getCount() {
return mEntries.size();
}
private class MyPagerAdapter extends FragmentPagerAdapter {
private TextProvider mProvider;
private long baseId = 0;
public MyPagerAdapter(FragmentManager fm, TextProvider provider) {
super(fm);
this.mProvider = provider;
}
#Override
public Fragment getItem(int position) {
if(position == 0){
return ScreenOne.newInstance(mProvider.getTextForPosition(position));
}
if(position == 1){
return ScreenTwo.newInstance(mProvider.getTextForPosition(position));
}
return ScreenTwo.newInstance(mProvider.getTextForPosition(position));
}
#Override
public int getCount() {
return mProvider.getCount();
}
//this is called when notifyDataSetChanged() is called
#Override
public int getItemPosition(Object object) {
// refresh all fragments when data set changed
return PagerAdapter.POSITION_NONE;
}
#Override
public long getItemId(int position) {
// give an ID different from position when position has been changed
return baseId + position;
}
/**
* Notify that the position of a fragment has been changed.
* Create a new ID for each position to force recreation of the fragment
* #param n number of items which have been changed
*/
public void notifyChangeInPosition(int n) {
// shift the ID returned by getItemId outside the range of all previous fragments
baseId += getCount() + n;
}
}
}
my fragment one:
public class ScreenOne extends Fragment {
private String mText;
public static ScreenOne newInstance(String text) {
ScreenOne f = new ScreenOne(text);
return f;
}
public ScreenOne() {
}
public ScreenOne(String text) {
this.mText = text;
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.screen_one, container, false);
((TextView) root.findViewById(R.id.position_one)).setText(mText);
return root;
}
}
my fragment two:
public class ScreenTwo extends Fragment {
private String mText;
public static ScreenTwo newInstance(String text) {
ScreenTwo f = new ScreenTwo(text);
return f;
}
public ScreenTwo() {
}
public ScreenTwo(String text) {
this.mText = text;
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.screen_two, container, false);
((TextView) root.findViewById(R.id.position_two)).setText(mText);
return root;
}
}
Thanks & Regards,
Aditya. J
Just override this method in FragmentpagerAdapter:
#Override
public void destroyItem(ViewGroup container, int position, Object object) {
super.destroyItem(ViewGroup container, int position, Object object);
}
And remove:
super.destroyItem(ViewGroup container, int position, Object object);

Two instances of the same ListFragment in one FragmentActivity using ViewPager

I have a FragmentActivity that uses a ViewPager to flip left and right through pages of data (two ListFragments).
public class StopsActivity extends FragmentActivity {
private ViewPager mViewPager;
private PagerTabStrip mPagerTabStrip;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_stops);
mPagerTabStrip =(PagerTabStrip)findViewById(R.id.pager_header);
mViewPager = (ViewPager)findViewById(R.id.pager);
mPagerTabStrip.setDrawFullUnderline(true);
mPagerTabStrip.setTabIndicatorColorResource(R.color.pagerTabStrip);
mViewPager.setAdapter(new StopsAdapter(getSupportFragmentManager()));
mViewPager.setCurrentItem(0);
}
private class StopsAdapter extends FragmentPagerAdapter {
public StopsAdapter(FragmentManager fm) {
super(fm);
}
#Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return StopsFragment.newInstance(routename, Stop.FORWARD);
case 1:
return StopsFragment.newInstance(routename, Stop.BACKWARD);
}
return null;
}
#Override
public int getCount() { return 2;}
#Override
public CharSequence getPageTitle(int position) { /* implementation ... */}
}
}
Everything runs ok, but I think that the instantation of the second StopFragment invalidate the data of the first one when getItem is called.
public class StopsFragment extends ListFragment {
private StopsAdapter mStopsAdapter;
private ListView mListView;
private String routename;
private int direction;
public static StopsFragment newInstance(String routename, int direction) {
StopsFragment stopsFragment = new StopsFragment();
// Supply arguments
Bundle args = new Bundle();
args.putString("routename", routename);
args.putInt("direction", direction);
stopsFragment.setArguments(args);
return stopsFragment;
}
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Setup the adapter
ArrayList<Stop> stops = ...
mStopsAdapter = new StopsAdapter(getActivity(), stops);
setRetainInstance(true);
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle inState) {
View rootView = inflater.inflate(R.layout.fragment_stops, container, false);
// Attach the adapter
mListView = (ListView) rootView.findViewById(android.R.id.list);
mListView.setAdapter(mStopsAdapter);
return rootView;
}
#Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}
}
The page "IDA" corresponds to StopFragment with argument Stop.FORWARD and the page "VUELTA" corresponds the StopFragment with argument Stop.BACKWARD. As you can see in the images below, just one of them (the last one instantiate) is populated:
What I'm doing wrong?
EDIT
This is StopsAdapter
class StopsAdapter extends BaseAdapter {
private ArrayList<Stop> stops;
private LayoutInflater inflater;
public StopsAdapter(Context context, ArrayList<Stop> stops) {
this.stops = stops;
this.inflater = LayoutInflater.from(context);
}
#Override
public int getCount() {
return stops.size();
}
#Override
public Object getItem(int position) {
return stops.get(position);
}
#Override
public long getItemId(int position) {
return (long)position;
}
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = inflater.inflate(R.layout.item_stop, parent, false);
}
TextView name = (TextView)convertView.findViewById(R.id.tvStopName);
TextView description = (TextView)convertView.findViewById(R.id.tvStopDescription);
Stop stop = (Stop)getItem(position);
name.setText(stop.name);
if (stop.info != null) {
description.setText(stop.info);
}
return convertView;
}
}
Ok, my fault. The code that was giving me problems is the only that I haven't posted (ArrayList<Stop> stops = ...). The code about Fragments and ViewPager works correctly.

ViewPagerIndicator tabs loses content

I am using Holoeverywhere and ViewPagerIndicator; using Holoeverywhere1 I implemented the slider and tabs in the Fragment using ViewPagerIndicator. Everything is working fine, Slider working, the menu in it, the tabs; the tabs works fine only the first time, when I move to other Fragment using the slider and come back to the tabs Fragment, the contents are no more available.
Code for the Fragment where tabs are created
public class SeconFrag extends Fragment {
ViewPager mViewPager;
FragmentAdapter mTabsAdapter;
PageIndicator mIndicator;
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mTabsAdapter = new FragmentAdapter(getSupportFragmentManager());
View view = inflater.inflate(R.layout.second_frag);
mViewPager = (ViewPager) view.findViewById(R.id.pager);
mViewPager.setAdapter(mTabsAdapter);
TitlePageIndicator indicator = (TitlePageIndicator) view
.findViewById(R.id.indicator);
indicator.setViewPager(mViewPager);
indicator.setFooterIndicatorStyle(IndicatorStyle.Triangle);
mIndicator = indicator;
return view;
}
#Override
public void onResume() {
super.onResume();
getSupportActionBar().setSubtitle("Create");
}
}
FragmentAdapter code
public class FragmentAdapter extends FragmentPagerAdapter{
protected static final String[] CONTENT = new String[] { "Choose", "Customise" };
private int mCount = CONTENT.length;
public FragmentAdapter(FragmentManager fm) {
super(fm);
}
#Override
public Fragment getItem(int position) {
if (position == 0) {
return TabOne.newInstance();
} else if (position == 1) {
return TabTwo.newInstance();
}else if (position == 3 ) {
return TabOne.newInstance();
}else
return null;
}
#Override
public int getCount() {
return mCount;
}
#Override
public CharSequence getPageTitle(int position) {
return FragmentAdapter.CONTENT[position % CONTENT.length];
}
public void setCount(int count) {
if (count > 0 && count <= 10) {
mCount = count;
notifyDataSetChanged();
}
}
}
on of the tab Fragment
public final class TabOne extends Fragment {
public static TabOne newInstance() {
TabOne fragment = new TabOne();
return fragment;
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View myFragmentView = inflater.inflate(R.layout.tab_one, container,
false);
return myFragmentView;
}
}
in the SeconFrag OnPause() I removed the Fragment no luck, hide() it in the OnPause() and tried to show() in the OnResume() still not showing content after the Fragment is changed.
EDIT

Categories

Resources