Java Android片段中带有句柄0xa1c126d0的0xa2ee7500(RippledRavable)上的EndAllActivateAnimators
我在开始片段时有这个错误。有时显示片段,有时不显示,应该只有一个空白屏幕显示。 在logcat显示时” 带手柄0xa1c126d0“的0xa2ee7500(RippledRavable)上的EndAllActivateAnimator 另外,请描述EndAllActivateAnimator 代码如下所示Java Android片段中带有句柄0xa1c126d0的0xa2ee7500(RippledRavable)上的EndAllActivateAnimators,java,android,android-fragments,rippledrawable,onsaveinstancestate,Java,Android,Android Fragments,Rippledrawable,Onsaveinstancestate,我在开始片段时有这个错误。有时显示片段,有时不显示,应该只有一个空白屏幕显示。 在logcat显示时” 带手柄0xa1c126d0“的0xa2ee7500(RippledRavable)上的EndAllActivateAnimator 另外,请描述EndAllActivateAnimator 代码如下所示 public class SingleArtViewDetail extends BaseActivity { @BindView(R.id.tabSingleartLayoutHom
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);
}
});
}}
碎片是
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);}}
公共类ViewArtDetailFragment扩展了BaseFragment{
语境;
弦乐艺术;
SingleImageModel SingleImageModel=新的SingleImageModel();
SingleArtDetail SingleArtDetail;
@BindView(R.id.layout\U artdetail)
线性布局布局图\u艺术详图;
@BindView(R.id.progressbar)
ProgressBar ProgressBar;
@BindView(R.id.pager)
图像视图寻呼机;
@BindView(R.id.horizontalscrlview)
水平滚动视图水平滚动视图;
@BindView(R.id.tv\U艺术标题)
TextView tv_arttitle;
@BindView(R.id.artbaseprice)
TextView电视节目基本价格;
@BindView(R.id.tv_artownername)
TextView tv_artownername;
@BindView(R.id.tv_Artdescrpn)
TextView电视节目;
@BindView(R.id.tv\U视图尺寸)
文本视图tv_视图尺寸;
@BindView(R.id.tv_视图创建年份)
TextView tv_viewyearofcreation;
@BindView(R.id.tv\U视图类别)
文本视图tv_视图类别;
@BindView(R.id.tv_viewsubject)
TextView tv_view主题;
@BindView(R.id.tv\U视图样式)
TextView tv_视图样式;
@BindView(R.id.tv\U视图材质)
TextView tv_viewmaterials;
@BindView(R.id.tv_viewmedium)
TextView电视和可视媒体;
@BindView(R.id.tv\U视图原件)
TextView tv_view原创;
@BindView(R.id.tv\U视图打印)
TextView tv_viewprint;
@BindView(R.id.缩略图)
线性布局-缩略图;
@BindView(R.id.tv_版权所有)
TextView tv_版权所有;
//专用GalleryPagerAdapter适配器;
私有ArrayList thumb_images=新ArrayList();
私有ArrayList gallery_images=新建ArrayList();
@凌驾
CreateView上的公共视图(布局、充气机、视图组容器、捆绑包保存状态){
视图=充气机。充气(R.layout.fragment\u View\u art\u details,container,false);
ButterKnife.bind(这个,视图);
context=getActivity();
ArtIdEvent ArtIdEvent=EventBus.getDefault().getStickyEvent(ArtIdEvent.class);
artid=artIdEvent.getArtId();
调用rtDetailAPI();
返回视图;
}
@凌驾
已创建ActivityState上的公共无效(Bundle savedInstanceState){
super.onActivityCreated(savedInstanceState);}
下面给出了片段xml
<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>
请帮助解决此问题,提前感谢
编辑
错误的完整日志(由OP在评论中发布):
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:0x9ecd8b80上的EndAllActivateImators(RippledRavable)带句柄0xa19a4540 06-29 13:07:03.612 24382-24382/com.cushbuart.cushbuart D/EventBus:没有为事件类com.cushbuart.cushbuart.eventmodel.ArtIdEvent 06-29 13:07:03.612 24382-24382/com.cushbuart.cushbuart D/EventBus注册订户:没有为事件类org.greenrobot.EventBus.NoSubscriberEvent注册订户
解决了我的问题,这是因为我的tablayout xml文件。 我把它改成了
<?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>
解决了我的问题,这是因为我的tablayout xml文件。 我把它改成了
<?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>
请务必提供错误的完整日志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:0x9ecd8b80上的EndAllActivateImators(RippledRavable)使用句柄0xa19a4540 06-29 13:07:03.612 24382-24382/com.cushbuart.cushbuart D/EventBus:没有为事件类com.cushbuart.cushbuart.eventmodel.ArtIdEvent 06-29 13:07:03.612 24382-24382/com.cushbuart.cushbuart D/EventBus注册的订阅者:没有为事件类org.greenrobot.EventBus注册的订阅者。NoSubscriberEvent@RahulKhurana可以请帮我解决这个问题。看起来您只发布了xml文件的一半。请更新完整版本和包含的布局。此外,请务必从相对性中删除方向。请务必提供错误的完整日志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:0x9ecd8b80(RippledRavable)上的EndallActivateAnimators使用句柄0xa19a4540 06-29 13:07:03.612 24382-24382/com.cushbuart.cushbuart D/EventBus:没有为事件类com.cushbuart.cushbuart.eventmodel.ArtIdEvent 06-29 13:07:03.612 24382-24382/com.cushbuart.cushbuart D/EventBus注册的订阅者:没有为事件类org.greenrobot.EventBus注册的订阅者。NoSubscriberEvent@RahulKhurana可以请帮我解决这个问题。看起来您只发布了xml文件的一半。请更新完整版本和包含的布局。另外,请从RelativeLayout中删除方向