相关疑难解决方法(0)

避免将null作为视图根传递(需要解析膨胀布局的根元素上的布局参数)

为root studio传递null给了我这个警告:

避免将null作为视图根传递(需要解析膨胀布局的根元素上的布局参数)

它显示为空值getGroupView.请帮忙.

public class ExpandableListAdapter extends BaseExpandableListAdapter {

    private Context _context;
    private List<String> _listDataHeader; // header titles
    // child data in format of header title, child title
    private HashMap<String, List<String>> _listDataChild;

    public ExpandableListAdapter(Context context, List<String> listDataHeader,
                                 HashMap<String, List<String>> listChildData) {
        super();
        this._context = context;
        this._listDataHeader = listDataHeader;
        this._listDataChild = listChildData;
    }

    @Override
    public Object getChild(int groupPosition, int childPosititon) {
        return this._listDataChild.get(this._listDataHeader.get(groupPosition))
                .get(childPosititon);
    }

    @Override
    public long getChildId(int groupPosition, int childPosition) {
        return childPosition;
    }

    @Override
    public …
Run Code Online (Sandbox Code Playgroud)

android warnings android-layout layout-inflater

218
推荐指数
6
解决办法
8万
查看次数

Android PopupWindow处于活动状态时模糊或暗淡背景

当我使用弹出窗口显示时,我希望能够模糊或调暗背景popup.showAtLocation,并在popup.dismiss调用时将背景解开/调暗.

我曾尝试应用布局PARAMS FLAG_BLUR_BEHINDFLAG_DIM_BEHIND我的活动,但这似乎只是一旦我的应用程序开始模糊和朦胧的背景.

如何使用弹出框进行模糊/调光?

android popupwindow android-popupwindow

77
推荐指数
6
解决办法
10万
查看次数

如何在android中修复"避免将null作为视图根"?

在我的Android应用程序中,我创建了一个这样的对话框:

private void handleEdit() {
    LayoutInflater inflater = getLayoutInflater();
    View dialoglayout = inflater.inflate(R.layout.dialog_gallery, null);

    final AlertDialog d = new AlertDialog.Builder(this)
    .setView(dialoglayout)
    .setTitle(R.string.edit)
    .setNegativeButton(R.string.cancel, null)
    .create();

    CheckBox mainCB = (CheckBox)dialoglayout.findViewById(R.id.main);
    CheckBox usedCB = (CheckBox)dialoglayout.findViewById(R.id.used);
    mainCB.setChecked(image.getIsMain());
    usedCB.setChecked(image.getApproved());

    mainCB.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            if (Network.isNetworkAvailable(GalleryScreen.this)) {
                new Async_update_image_state(GalleryScreen.this, fish, image, !image.getIsMain(), image.getApproved(), false);
                d.dismiss();
            } else {
                Popup.ShowErrorMessage(GalleryScreen.this, R.string.no_internet, false);
            }
        }
    });

    usedCB.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            if (Network.isNetworkAvailable(GalleryScreen.this)) {
                new Async_update_image_state(GalleryScreen.this, fish, image, …
Run Code Online (Sandbox Code Playgroud)

android android-alertdialog

8
推荐指数
2
解决办法
9420
查看次数