1

J'ai cette erreur sur le démarrage Fragment. Parfois, le fragment montrant, parfois non, il devrait y avoir seulement un écran vide. Au logcat temps montre " endAllActiveAnimators sur 0xa2ee7500 (RippleDrawable) avec poignée 0xa1c126d0"endAllActiveAnimators sur 0xa2ee7500 (RippleDrawable) avec le handle 0xa1c126d0 dans Android Fragment

également S'il vous plaît décrire les endAllActiveAnimators

Le code est donné ci-dessous

public class SingleArtViewDetail extends BaseActivity { 

@BindView(R.id.tabSingleartLayoutHome) 
TabLayout tabLayout; 
@BindView(R.id.viewPagerSingleartHome) 
ViewPager viewPager; 
ViewPagerAdapter viewPagerAdapter; 
private ViewArtDetailFragment viewArtDetailFragment = new ViewArtDetailFragment(); 
private CommentsFragment commentsFragment = new CommentsFragment(); 
private SimilarArtFragment similarArtFragment = new SimilarArtFragment(); 
Activity activity; 
@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_single_art_view_detail); 
    if(getIntent()!=null) { 
     EventBus.getDefault().postSticky(new ArtIdEvent(getIntent().getStringExtra("artid"))); 

    } 
    ButterKnife.bind(this); 
    setToolBar(""); 
    setTabs(); 
    activity=SingleArtViewDetail.this; 
    // EventBus.getDefault().register(this); 
} 

@Override 
protected void onDestroy() { 
// EventBus.getDefault().unregister(this); 
    super.onDestroy(); 
} 

private void setTabs() { 
    viewPagerAdapter = new ViewPagerAdapter(getSupportFragmentManager()); 
    viewPagerAdapter.addFrag(viewArtDetailFragment, ""); 
    viewPagerAdapter.addFrag(commentsFragment, ""); 
    viewPagerAdapter.addFrag(similarArtFragment, ""); 
    viewPager.setAdapter(viewPagerAdapter); 
    viewPager.setOffscreenPageLimit(3); 
    tabLayout.setupWithViewPager(viewPager); 
    final int[] ICONS = new int[]{ 
      R.drawable.ic_addtocart, 
      R.drawable.ic_comments, 
      R.drawable.ic_similaritems}; 
    final int[] ICONSUNSELECTED = new int[]{ 
      R.drawable.ic_addtocartselected, 
      R.drawable.ic_commentsselected, 
      R.drawable.ic_similaritemsselected}; 
    tabLayout.getTabAt(0).setIcon(ICONS[0]); 
    tabLayout.getTabAt(1).setIcon(ICONSUNSELECTED[1]); 
    tabLayout.getTabAt(2).setIcon(ICONSUNSELECTED[2]); 
    tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { 
     @Override 
     public void onTabSelected(TabLayout.Tab tab) { 
      System.out.println("selected"+tab.getPosition()); 
      switch (tab.getPosition()) 
      { 
       case 0: 
        tabLayout.getTabAt(0).setIcon(ICONS[0]); 
        break; 
       case 1: 
        tabLayout.getTabAt(1).setIcon(ICONS[1]); 

        break; 
       case 2: 
        tabLayout.getTabAt(2).setIcon(ICONS[2]); 
        break; 
      } 
      // tab.setIcon(R.drawable.newicon); 
      //also you can use tab.setCustomView() too 
     } 

     @Override 
     public void onTabUnselected(TabLayout.Tab tab) { 
      //tab.setIcon(R.drawable.oldicon); 
      System.out.println("unselected"+tab.getPosition()); 
      switch (tab.getPosition()) 
      { 
       case 0: 
        tabLayout.getTabAt(0).setIcon(ICONSUNSELECTED[0]); 
        break; 
       case 1: 
        tabLayout.getTabAt(1).setIcon(ICONSUNSELECTED[1]); 

        break; 
       case 2: 
        tabLayout.getTabAt(2).setIcon(ICONSUNSELECTED[2]); 
        break; 
      } 
     } 

     @Override 
     public void onTabReselected(TabLayout.Tab tab) { 
      System.out.println(tab); 
     } 
    }); 
}} 

fragmenter est

public class ViewArtDetailFragment extends BaseFragment { 

Context context; 
String artid; 
SingleImageModel singleImageModel = new SingleImageModel(); 
SingleArtDetail singleArtDetail; 
@BindView(R.id.layout_artdetail) 
LinearLayout layout_artdetail; 
@BindView(R.id.progressbar) 
ProgressBar progressbar; 
@BindView(R.id.pager) 
ImageView viewPager; 
@BindView(R.id.horizontalscrlview) 
HorizontalScrollView horizontalscrlview; 
@BindView(R.id.tv_arttitle) 
TextView tv_arttitle; 
@BindView(R.id.artbaseprice) 
TextView tv_artbaseprice; 
@BindView(R.id.tv_artownername) 
TextView tv_artownername; 
@BindView(R.id.tv_artdescrptn) 
TextView tv_artdescrptn; 
@BindView(R.id.tv_viewdimension) 
TextView tv_viewdimension; 
@BindView(R.id.tv_viewyearofcreation) 
TextView tv_viewyearofcreation; 
@BindView(R.id.tv_viewcategory) 
TextView tv_viewcategory; 
@BindView(R.id.tv_viewsubject) 
TextView tv_viewsubject; 
@BindView(R.id.tv_viewstyle) 
TextView tv_viewstyle; 
@BindView(R.id.tv_viewmaterials) 
TextView tv_viewmaterials; 
@BindView(R.id.tv_viewmedium) 
TextView tv_viewmedium; 
@BindView(R.id.tv_vieworiginal) 
TextView tv_vieworiginal; 
@BindView(R.id.tv_viewprint) 
TextView tv_viewprint; 
@BindView(R.id.thumbnails) 
LinearLayout _thumbnails; 

@BindView(R.id.tv_copyright) 
TextView tv_copyright; 
// private GalleryPagerAdapter _adapter; 
private ArrayList<String> thumb_images = new ArrayList<>(); 
private ArrayList<String> gallery_images = new ArrayList<>(); 

@Override 
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 

    View view = inflater.inflate(R.layout.fragment_view_art_details, container, false); 
    ButterKnife.bind(this, view); 
    context = getActivity(); 
    ArtIdEvent artIdEvent = EventBus.getDefault().getStickyEvent(ArtIdEvent.class); 
    artid = artIdEvent.getArtId(); 
    callingArtDetailApi(); 
    return view; 
} 

@Override 
public void onActivityCreated(Bundle savedInstanceState) { 
    super.onActivityCreated(savedInstanceState);}} 

Le fragment xml est donné ci-dessous

<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:orientation="vertical" 
android:layout_height="match_parent" 
> 
<ProgressBar 

    android:id="@+id/progressbar" 
    android:layout_centerInParent="true" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" /> 
<LinearLayout 
    android:visibility="gone" 

    android:id="@+id/layout_artdetail" 
    android:layout_below="@+id/toolbar" 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent"> 
    <ScrollView 

     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 
     <LinearLayout 

      android:layout_marginBottom="80dp" 
      android:orientation="vertical" 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      > 
      <ImageView 
       android:layout_marginRight="@dimen/tabsmall_margin" 
       android:layout_marginLeft="@dimen/tabsmall_margin" 
       android:id="@+id/pager" 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/viewpagerheight" 
       > 
      </ImageView> 



      <HorizontalScrollView 
       android:id="@+id/horizontalscrlview" 
       android:layout_marginRight="@dimen/tabsmall_margin" 
       android:layout_marginLeft="@dimen/tabsmall_margin" 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/horizonalscrollheight" 
       android:layout_gravity="bottom" 
       > 
       <LinearLayout 
        android:id="@+id/thumbnails" 
        android:layout_width="wrap_content" 
        android:layout_height="match_parent" 
        android:gravity="center_vertical" 
        android:orientation="horizontal" 
        android:paddingTop="2dp"> 

       </LinearLayout> 
      </HorizontalScrollView> 
      <include 
       layout="@layout/content_view_art_detail"/> 
     </LinearLayout> 
    </ScrollView> 
</LinearLayout> 

S'il vous plaît aider à résoudre ce problème, merci à l'avance.

EDIT

journal complet de l'erreur (Publié par OP dans les commentaires):

06-29 13: 06: 55,702 24382-24382/com.cushbuart.cushbuart E/log : onsavedInstanceState 06-29 13: 07: 01.840 24382-24525/com.cushbuart.cushbuart D/OpenGLRenderer: endAllActiveAnimators sur 0x9ecd8b80 (RippleDrawable) avec le handle 0xa19a4540 06-29 13: 07: 03.612 24382-24382/com.cushbuart.cushbuart D/EventBus: Aucun abonné inscrit à la classe d'événement com.cushbuart.cushbuart.eventmodel.ArtIdEvent 06-29 13: 07: 03.612 24382-24382/com.cushbuart.cushbuart D/EventBus: Aucun sous-abonnement ribers enregistré pour la classe d'événement org.greenrobot.eventbus.NoSubscriberEvent

+0

S'il vous plaît ne fournir le journal complet de l'erreur –

+0

06-29 13: 06: 55,702 24382-24382/com.cushbuart.cushbuart E/log: onsavedInstanceState 06-29 13:07: 01.840 24382-24525/com.cushbuart.cushbuart D/OpenGLRenderer: endAllActiveAnimators sur 0x9ecd8b80 (RippleDrawable) avec le handle 0xa19a4540 06-29 13: 07: 03.612 24382-24382/com.cushbuart.cushbuart D/EventBus: Aucun souscripteur inscrit pour l'événement classe com.cushbuart.cushbuart.eventmodel.ArtIdEvent 06-29 13: 07: 03.612 24382-24382/com.cushbuart.cushbuart D/EventBus: Aucun abonné inscrit à la classe d'événement org.greenrobot.eventbus.NoSubscriberEvent – susaine

+0

@RahulKhurana pouvez-vous S'il vous plaît aider m e pour résoudre cela. – susaine

Répondre

0

a résolu mon problème c'est à cause de mon fichier xml tablayout. i changé que pour

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    > 


    <include 
     layout="@layout/toolbar"/> 

    <android.support.v4.view.ViewPager 
     android:layout_below="@+id/toolbar" 
     android:id="@+id/viewPagerSingleartHome" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior" 
     /> 


    <android.support.design.widget.TabLayout 
     android:id="@+id/tabSingleartLayoutHome" 
     app:tabMode="fixed" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="?attr/colorPrimary" 
     android:elevation="6dp" 
     app:tabTextColor="#d3d3d3" 
     app:tabSelectedTextColor="@color/colorwhite" 
     app:tabIndicatorColor="@color/colorwhite" 
     android:minHeight="?attr/actionBarSize" 
     android:layout_alignParentBottom="true" 
     /> 
</RelativeLayout>