Android 如何使用.withBadge在材料抽屉中添加改装数据

Android 如何使用.withBadge在材料抽屉中添加改装数据,android,retrofit,drawer,Android,Retrofit,Drawer,我在安卓系统中使用材料抽屉。我想显示待处理的总数量,而不是“0”。它来自服务器。这是我的密码 SecondaryDrawerItem drawerPending = new SecondaryDrawerItem().withName(R.string.drawer_item_pending); Drawer result = new DrawerBuilder() .withActivity(this) .withToolbar(

我在安卓系统中使用材料抽屉。我想显示待处理的总数量,而不是“0”。它来自服务器。这是我的密码

SecondaryDrawerItem drawerPending = new SecondaryDrawerItem().withName(R.string.drawer_item_pending);
Drawer result = new DrawerBuilder()
                .withActivity(this)
                .withToolbar(toolbar)
                .withAccountHeader(headerResult)
                .addDrawerItems(
                        new PrimaryDrawerItem().withName(R.string.drawer_item_pending).withIcon(MaterialDesignIconic.Icon.gmi_truck).withBadge("0"),
                .build();



user = StoreUtil.getInstance().selectFrom("users");
NetworkEngine.getInstance().getShippingList(user.getId(), new Callback<MyOrderList>() {
            @Override
            public void success(MyOrderList myOrderList, Response response) {
              //  txt_pending_totalQty.setText(myOrderList.getNotshippinglist().toString());
            }
        });
SecondaryDrawerItem-drawerPending=new SecondaryDrawerItem().withName(R.string.drawer\u item\u pending);
抽屉结果=新抽屉生成器()
.withActivity(本)
.withToolbar(工具栏)
.withAccountHeader(headerResult)
艾德瑞特姆斯先生(
新PrimaryDrawerItem()。带名称(R.string.drawer\u item\u pending)。带图标(MaterialDesignignic.Icon.gmi\u truck)。带徽章(“0”),
.build();
user=StoreUtil.getInstance().selectFrom(“用户”);
NetworkEngine.getInstance().getShippingList(user.getId(),new Callback()){
@凌驾
公共无效成功(MyOrderList MyOrderList,响应){
//txt_pending_totalQty.setText(myOrderList.getNotshippinglist().toString());
}
});

好的,那么问题出在哪里呢?相反,对于Badge(“0”),我想从myOrderList添加数据。getNotshippinglist()。toString()(“0”)是静态的。