小编huz*_*n07的帖子

隐藏导航抽屉菜单项 - Android

我有一个导航抽屉.当一个事件被调用时,我想为用户隐藏我的一个导航菜单项.我怎样才能做到这一点?

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.sliding_menu);

    if (android.os.Build.VERSION.SDK_INT > 9) {
        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
        StrictMode.setThreadPolicy(policy);
    }
    mTitle = mDrawerTitle = getTitle();

    // load slide menu items
    navMenuTitles = getResources().getStringArray(R.array.nav_drawer_items);

    // nav drawer icons from resources
    navMenuIcons = getResources()
            .obtainTypedArray(R.array.nav_drawer_icons);

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout1);
    mDrawerList = (ListView) findViewById(R.id.list_slidermenu1);

    navDrawerItems = new ArrayList<NavDrawerItem>();

    // adding nav drawer items to array
    // Home
    navDrawerItems.add(new NavDrawerItem(navMenuTitles[0], navMenuIcons.getResourceId(0, -1)));
    // Profil
    navDrawerItems.add(new NavDrawerItem(navMenuTitles[1], navMenuIcons.getResourceId(1, -1)));
    // Prospek
    navDrawerItems.add(new NavDrawerItem(navMenuTitles[2], navMenuIcons.getResourceId(2, -1))); …
Run Code Online (Sandbox Code Playgroud)

android hide navigation-drawer

50
推荐指数
3
解决办法
6万
查看次数

Android Studio:无法安装应用程序:SHELL_UNRESPONSIVE

我正在尝试从我的 android studio 安装我的应用程序调试。它昨天运行良好,但是今天当我尝试再次安装它时,该应用程序无法安装在我的设备上,并在我的 android studio 上显示如下错误。

Installation did not succeed.
The application could not be installed: SHELL_UNRESPONSIVE
The device timed out while trying to install the application.
Retry
Run Code Online (Sandbox Code Playgroud)

我该怎么办?我尝试在其他设备上安装,它工作正常。我的设备是红米 4X,其他设备是三星 J3

android android-studio

5
推荐指数
2
解决办法
9849
查看次数

标签 统计

android ×2

android-studio ×1

hide ×1

navigation-drawer ×1