android--之笔记(一)

来源:互联网 发布:瓷砖店设计软件 编辑:程序博客网 时间:2024/06/04 18:43

默认值

public class MainActivity extends Fragment {

    public static final String TAG = MainActivity.class.getSimpleName();

    private String isShowIndex = "0";
    private View mView;

此默认值"0"决定Activity首先显示哪个菜单页,注意这里直接改下面的相对的值是不可行的,必须要直接改定义 private String isShowIndex = "0";的值

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


// 右侧菜单过来
        if ("0".equals(isShowIndexParams)) {
            Constants.mRadioGroup.check(R.id.main_home);
            isShowIndex = "0";

        } else if ("1".equals(isShowIndexParams)) {
            Constants.mRadioGroup.check(R.id.main_search);
            isShowIndex = "1";

        } else if ("2".equals(isShowIndexParams)) {
            Constants.mRadioGroup.check(R.id.main_new);
            isShowIndex = "2";

        } else if ("3".equals(isShowIndexParams)) {
            Constants.mRadioGroup.check(R.id.main_shopcar);
            isShowIndex = "3";

        } else if ("4".equals(isShowIndexParams)) {
            Constants.mRadioGroup.check(R.id.main_center);
            isShowIndex = "4";

//        } else {
//            Constants.mRadioGroup.check(R.id.main_home);
//            isShowIndex = "2";
        }

    }


0 0
原创粉丝点击