Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 无法从导航抽屉触发活动_Android - Fatal编程技术网

Android 无法从导航抽屉触发活动

Android 无法从导航抽屉触发活动,android,Android,在我的应用程序中实现了导航抽屉。一切正常,只是我无法触发抽屉项目的任何活动 这是我的MainActivity.java public class MainActivity extends SherlockFragmentActivity implements AdapterView.OnItemClickListener, View.OnClickListener, Animation.AnimationListener { private Animation slideRight, s

在我的应用程序中实现了导航抽屉。一切正常,只是我无法触发抽屉项目的任何活动

这是我的MainActivity.java

 public class MainActivity extends SherlockFragmentActivity implements    AdapterView.OnItemClickListener, View.OnClickListener, Animation.AnimationListener {
private Animation slideRight, slideLeft;
private FrameLayout myLayout, myLayoutt, myLayouth, myLayoutf, mylayoutfi;
private Button showView, hideView;
private Animation animFadeIn, animFadeOut;



// Declare Variables
DrawerLayout mDrawerLayout;
ListView mDrawerList;
ActionBarDrawerToggle mDrawerToggle;
MenuListAdapter mMenuAdapter;
String[] title;
String[] subtitle;
int[] icon;
Fragment fragment1 = new Fragment1();

private CharSequence mDrawerTitle;
private CharSequence mTitle;

@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
   // Get the view from drawer_main.xml
    setContentView(R.layout.drawer_main);

    animFadeIn = AnimationUtils.loadAnimation(getApplicationContext(),
            R.anim.fade_in);
    animFadeOut = AnimationUtils.loadAnimation(getApplicationContext(),
            R.anim.fade_out);
    animFadeIn.setAnimationListener(this);
    animFadeOut.setAnimationListener(this);
    myLayout = (FrameLayout) findViewById(R.id.elo);
    myLayoutt = (FrameLayout) findViewById(R.id.elf);
    myLayouth = (FrameLayout) findViewById(R.id.elg);
    myLayoutf = (FrameLayout) findViewById(R.id.elco);
    mylayoutfi = (FrameLayout) findViewById(R.id.ele);
    slideRight = AnimationUtils.loadAnimation(this, R.anim.slide_right);
    slideLeft = AnimationUtils.loadAnimation(this, R.anim.slide_left);
    slideLeft.setAnimationListener(animationListener);
    myLayoutt.startAnimation(slideLeft);
    myLayoutt.setVisibility(View.VISIBLE);
    myLayout.startAnimation(slideRight);
    myLayout.setVisibility(View.VISIBLE);
    myLayoutf.startAnimation(slideLeft);
    myLayoutf.setVisibility(View.VISIBLE);
    myLayouth.startAnimation(slideRight);
    myLayouth.setVisibility(View.VISIBLE);
    mylayoutfi.startAnimation(slideRight);
    mylayoutfi.setVisibility(View.VISIBLE);


  // Get the Title
    mTitle = mDrawerTitle = getTitle();

 // Generate title
    title = new String[] { "News", "Videos", "Photos" };
  };

 // Generate icon
    icon = new int[] { R.drawable.action_about, R.drawable.action_about,
            R.drawable.collections_cloud};

   // Locate DrawerLayout in drawer_main.xml
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);

  // Locate ListView in drawer_main.xml
    mDrawerList = (ListView) findViewById(R.id.listview_drawer);

  // Set a custom shadow that overlays the main content when the drawer
  // opens
    mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,
            GravityCompat.START);

  // Pass string arrays to MenuListAdapter
    mMenuAdapter = new MenuListAdapter(MainActivity.this, title,
            icon);

   // Set the MenuListAdapter to the ListView
    mDrawerList.setAdapter(mMenuAdapter);

   // Capture listview menu item click
    mDrawerList.setOnItemClickListener(MainActivity.this);

   // Enable ActionBar app icon to behave as action to toggle nav drawer
    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    // ActionBarDrawerToggle ties together the the proper interactions
    // between the sliding drawer and the action bar app icon
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
            R.drawable.ic_drawer, R.string.drawer_open,
            R.string.drawer_close) {

        public void onDrawerClosed(View view) {
    // TODO Auto-generated method stub
            super.onDrawerClosed(view);
        }

        public void onDrawerOpened(View drawerView) {
    // TODO Auto-generated method stub
    // Set the title on the action when drawer open
            getSupportActionBar().setTitle(mDrawerTitle);
            super.onDrawerOpened(drawerView);
        }
    };

    mDrawerLayout.setDrawerListener(mDrawerToggle);

    if (savedInstanceState == null) {
        selectItem(0);
    }
  }

@Override
public boolean onOptionsItemSelected(MenuItem item) {

    if (item.getItemId() == android.R.id.home) {

        if (mDrawerLayout.isDrawerOpen(mDrawerList)) {
            mDrawerLayout.closeDrawer(mDrawerList);
        } else {
            mDrawerLayout.openDrawer(mDrawerList);
        }
    }

    return super.onOptionsItemSelected(item);
  }

  // ListView click listener in the navigation drawer



@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {

selectItem(position);

    mDrawerLayout.closeDrawer(mDrawerList);

switch(position){

    case 0 :{

        Toast.makeText(getApplicationContext(), "Please Mention Quantity",
                Toast.LENGTH_SHORT).show();
        return;
    }

    case 1:{

        Intent t2l = new Intent(MainActivity.this, Fragment2.class);
        startActivity(t2l);

        return;
    }

    case 2 :{

        Toast.makeText(getApplicationContext(), "Second Item",
                Toast.LENGTH_SHORT).show();
        break;
    }



}

}

private void selectItem(int position) {

    mDrawerList.setItemChecked(position, true);

    setTitle(title[position]);

}









@Override
protected void onPostCreate(Bundle savedInstanceState) {
    super.onPostCreate(savedInstanceState);
 // Sync the toggle state after onRestoreInstanceState has occurred.
    mDrawerToggle.syncState();
 }

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
 // Pass any configuration change to the drawer toggles
    mDrawerToggle.onConfigurationChanged(newConfig);
}

@Override
public void setTitle(CharSequence title) {
    mTitle = title;
    getSupportActionBar().setTitle(mTitle);
}

private Animation.AnimationListener animationListener = new   Animation.AnimationListener(){

    @Override
    public void onAnimationEnd(Animation animation) {


    }

    @Override
    public void onAnimationRepeat(Animation animation) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onAnimationStart(Animation animation) {
        // TODO Auto-generated method stub

    }};

@Override
public void onClick(View arg0) {
    // TODO Auto-generated method stub

}



@Override
public void onAnimationEnd(Animation animation) {
    // Take any action after completing the animation

    // if animation is fade out hide them after completing animation
    if (animation == animFadeOut) {


    }

    if(animation == animFadeIn){
        // do something after fade in completed

        // set visibility of fade in element

    }

}

@Override
public void onAnimationRepeat(Animation animation) {
    // TODO Auto-generated method stub

}

@Override
public void onAnimationStart(Animation animation) {
    // TODO Auto-generated method stub

}



}
公共类MainActivity扩展SherlockFragmentActivity实现AdapterView.OnItemClickListener、View.OnClickListener、Animation.AnimationListener{
私人动画slideRight,slideLeft;
专用框架布局myLayout,myLayoutt,myLayouth,myLayout,MyLayouti;
私有按钮显示视图,隐藏视图;
私有动画animFadeIn,animFadeOut;
//声明变量
抽屉布局mDrawerLayout;
ListView mDrawerList;
ActionBarDrawerToggle mDrawerToggle;
MenuListAdapter mMenuAdapter;
字符串[]标题;
字符串[]副标题;
int[]图标;
Fragment fragment1=新的fragment1();
私有字符序列mDrawerTitle;
私有字符序列mTitle;
@凌驾
创建时的公共void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
//从drawer_main.xml获取视图
setContentView(右布局,抽屉主视图);
animFadeIn=AnimationUtils.loadAnimation(getApplicationContext(),
R.anim.淡入);
animfeadeout=AnimationUtils.loadAnimation(getApplicationContext(),
R.anim.淡出);
setAnimationListener(这个);
设置AnimationListener(此);
myLayout=(FrameLayout)findViewById(R.id.elo);
myLayoutt=(FrameLayout)findViewById(R.id.elf);
myLayouth=(框架布局)findViewById(R.id.elg);
MyLayout=(框架布局)findViewById(R.id.elco);
MyLayouthi=(框架布局)findViewById(R.id.ele);
slideRight=AnimationUtils.loadAnimation(这是R.anim.slide\u right);
slideLeft=AnimationUtils.loadAnimation(这个,R.anim.slide_左);
slideLeft.setAnimationListener(animationListener);
myLayoutt.startAnimation(slideLeft);
myLayoutt.setVisibility(View.VISIBLE);
myLayout.startAnimation(右滑块);
myLayout.setVisibility(View.VISIBLE);
Mylayout.startAnimation(slideLeft);
mylayout.setVisibility(View.VISIBLE);
myLayouth.startAnimation(幻灯片右侧);
myLayouth.setVisibility(View.VISIBLE);
Mylayouthi.startAnimation(幻灯片右);
MyLayouthi.setVisibility(View.VISIBLE);
//得名
mTitle=mDrawerTitle=getTitle();
//生成标题
title=新字符串[]{“新闻”、“视频”、“照片”};
};
//生成图标
icon=new int[]{R.drawable.action\u about,R.drawable.action\u about,
R.drawable.collections_cloud};
//在drawer_main.xml中找到抽屉布局
mDrawerLayout=(抽屉布局)findViewById(R.id.抽屉布局);
//在drawer_main.xml中找到ListView
mDrawerList=(ListView)findViewById(R.id.ListView\u抽屉);
//当抽屉打开时,设置覆盖主要内容的自定义阴影
//打开
mDrawerLayout.setDrawerShadow(R.drawable.DrawerShadow,
重力比较(启动);
//将字符串数组传递给MenuListAdapter
mMenuAdapter=new MenuListAdapter(MainActivity.this,title,
图标);
//将MenuListAdapter设置为ListView
mDrawerList.setAdapter(mMenuAdapter);
//捕获列表视图菜单项单击
mDrawerList.setOnItemClickListener(MainActivity.this);
//启用ActionBar应用程序图标作为切换导航抽屉的操作
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//ActionBarDrawerToggle将适当的交互连接在一起
//在滑动抽屉和操作栏应用程序图标之间
mDrawerToggle=新操作BarDrawerToggle(此,mDrawerLayout,
R.drawable.ic_抽屉,R.string.drawer_抽屉打开,
右弦抽屉(U关闭){
公共无效onDrawerClosed(视图){
//TODO自动生成的方法存根
super.onDrawerClosed(视图);
}
打开图纸上的公共空白(视图抽屉视图){
//TODO自动生成的方法存根
//设置抽屉打开时动作的标题
getSupportActionBar().setTitle(mDrawerTitle);
super.onDrawerOpened(抽屉视图);
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
如果(savedInstanceState==null){
选择项目(0);
}
}
@凌驾
公共布尔值onOptionsItemSelected(菜单项项){
if(item.getItemId()==android.R.id.home){
if(mDrawerLayout.isDrawerOpen(mDrawerList)){
mDrawerLayout.closeDrawer(mDrawerList);
}否则{
mDrawerLayout.openDrawer(mDrawerList);
}
}
返回super.onOptionsItemSelected(项目);
}
//ListView单击导航抽屉中的侦听器
@凌驾
public void onItemClick(适配器视图arg0、视图arg1、内部位置、长arg3){
选择项目(位置);
mDrawerLayout.closeDrawer(mDrawerList);
开关(位置){
案例0:{
Toast.makeText(getApplicationContext(),“请提及数量”,
吐司。长度(短)。show();
返回;
}
案例1:{
意图t2l=新意图(MainActivity.this,Fragment2.class);
星形触觉(t2l);
返回;
}
案例2:{
Toast.makeText(getApplicationContext(),“第二项”,
吐司。长度(短)。show();
打破
}
}
}
私有void selectItem(内部位置){
mDrawerList.setItemChecked(位置,true);
设置标题(标题[职位]);
}
@凌驾
后期创建时受保护的空(捆绑包savedInstanceState){
super.onPostCreate(savedInstanceState);
//在onRestoreInstanceState发生后同步切换状态。
mDrawerToggle.syncState();
}
@凌驾
公共无效OnConfiguration已更改(配置newConfig){
super.onConfigurationChanged(newConfig);
//将任何配置更改传递给抽屉开关
mDrawerToggle.onConfigurationChanged(newConfig);
}
@凌驾
公共无效设置标题(字符序列标题){
mTitle=标题;
getSupportActionBar().setTitle(mTitle);
}
私有Animation.AnimationListener AnimationListener=ne
 <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >


<ListView
    android:id="@+id/listview_drawer"
    android:layout_width="240dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:background="#111"
    android:choiceMode="singleChoice"
    android:divider="@android:color/transparent"
    android:dividerHeight="1dp" />
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:background="#fff">
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:background="#fff">


        <ImageButton
            android:layout_width="fill_parent"
            android:layout_height="200dp"
            android:id="@+id/clo"
            android:layout_alignParentTop="true"
            android:layout_marginBottom="5dp"

            android:padding="5dp"
            android:background="@drawable/job" />

        <RelativeLayout
            android:id="@+id/newsl"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/cloth">
            <ImageButton
                android:layout_width="100dp"
                android:layout_height="100dp"
                android:id="@+id/newsimone"
                android:layout_alignParentTop="true"
                android:layout_marginBottom="5dp"

                android:padding="5dp"
                android:background="@drawable/job" />
            <TextView
                android:layout_width="fill_parent"
                android:layout_height="100dp"
                android:layout_toRightOf="@id/newsimone"/>
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/newsl2"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/newsl">
            <ImageButton
                android:layout_width="100dp"
                android:layout_height="100dp"
                android:id="@+id/newsimtwo"
                android:layout_alignParentTop="true"
                android:layout_marginBottom="5dp"

                android:padding="5dp"
                android:background="@drawable/job" />
            <TextView
                android:layout_width="fill_parent"
                android:layout_height="100dp"
                android:layout_toRightOf="@id/newsimtwo"/>
        </RelativeLayout>
        <RelativeLayout
            android:id="@+id/catl"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/newsl2"
            android:layout_marginBottom="5dp">
            <View android:id="@+id/strut"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_alignParentLeft="true"
                android:layout_margin="1dp"/>
            <View android:id="@+id/strut2"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_alignParentRight="true"
                android:layout_margin="1dp"/>
            <FrameLayout android:id="@+id/elo"
                android:layout_toRightOf="@id/strut"
                android:layout_toLeftOf="@id/strut2"
                android:layout_width="fill_parent"      android:layout_height="wrap_content"
                android:background="@drawable/cell_shape"     android:visibility="gone">
                <ExpandableListView
                    android:id="@+id/eloc"
                    android:layout_width="fill_parent"
                    android:layout_height="30dp"
                    android:layout_toRightOf="@id/strut"
                    android:layout_toLeftOf="@id/strut2"
                    android:background="@color/al"
                    android:layout_margin="2dp"></ExpandableListView>
            </FrameLayout>
            <FrameLayout android:id="@+id/elf"
                android:layout_toRightOf="@id/strut"
                android:layout_toLeftOf="@id/strut2"
                android:layout_below="@id/eloc"
                android:layout_width="fill_parent" android:layout_height="wrap_content"
                android:background="@drawable/cell_shape" android:visibility="gone">
                <ExpandableListView
                    android:id="@+id/elfc"
                    android:layout_margin="2dp"

                    android:layout_width="fill_parent"
                    android:layout_height="30dp"
                    android:layout_toRightOf="@id/strut"
                    android:layout_toLeftOf="@id/strut2"
                    android:background="@color/bl"></ExpandableListView>
            </FrameLayout>
            <FrameLayout android:id="@+id/ele"
                android:layout_toRightOf="@id/strut"
                android:layout_toLeftOf="@id/strut2"
                android:layout_below="@id/elfoodc"
                android:layout_width="fill_parent"  android:layout_height="wrap_content"
                android:background="@drawable/cell_shape" android:visibility="gone">
                <ExpandableListView
                    android:id="@+id/elec"
                    android:layout_margin="2dp"
                    android:layout_toRightOf="@id/strut"
                    android:layout_toLeftOf="@id/strut2"
                    android:layout_width="fill_parent"
                    android:layout_height="30dp"
                    android:background="@color/bg"></ExpandableListView>
            </FrameLayout>
            <FrameLayout android:id="@+id/elg"
                android:layout_toRightOf="@id/strut"
                android:layout_toLeftOf="@id/strut2"
                android:layout_below="@id/elec"
                android:layout_width="fill_parent" android:layout_height="wrap_content"
                android:background="@drawable/cell_shape" android:visibility="gone">

                <ExpandableListView
                    android:id="@+id/elgc"
                    android:layout_margin="2dp"
                    android:layout_width="fill_parent"
                    android:layout_height="30dp"
                    android:layout_toRightOf="@id/strut"
                    android:layout_toLeftOf="@id/strut2"
                    android:background="@color/bla"></ExpandableListView>
            </FrameLayout>
            <FrameLayout android:id="@+id/elco"
                android:layout_toRightOf="@id/strut"
                android:layout_toLeftOf="@id/strut2"
                android:layout_below="@id/eleduc"
                android:layout_width="fill_parent" android:layout_height="wrap_content"
                android:background="@drawable/cell_shape" android:visibility="gone">
                <ExpandableListView
                    android:id="@+id/elcoc"
                    android:layout_margin="2dp"
                    android:layout_width="fill_parent"
                    android:layout_height="30dp"
                    android:layout_toRightOf="@id/strut"
                    android:layout_toLeftOf="@id/strut2"
                    android:background="@color/r"></ExpandableListView>
            </FrameLayout>


        </RelativeLayout>

        <TextView
            android:layout_below="@id/catl"
            android:layout_width="match_parent"
            android:layout_height="70dp"
            android:background="@color/dg"
            android:gravity="center"
            android:layout_centerHorizontal="true"
            android:layout_alignParentBottom="true"
            android:textColor="@color/wh"
            android:textStyle="bold"
            android:textSize="30sp"/>

    </RelativeLayout></ScrollView>

    <FrameLayout
    android:id="@+id/content_frame"
    android:layout_width="fill_parent"
    android:layout_height="match_parent" />
    </android.support.v4.widget.DrawerLayout></LinearLayout>
 <android.support.v4.widget.DrawerLayout
 android:id="@+id/drawer_layout"
  android:layout_width="match_parent"
  android:layout_height="match_parent" >

    <LinearLayout

    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

<ScrollView 
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="#fff">
<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:background="#fff">


    <ImageButton
        android:layout_width="fill_parent"
        android:layout_height="200dp"
        android:id="@+id/clo"
        android:layout_alignParentTop="true"
        android:layout_marginBottom="5dp"

        android:padding="5dp"
        android:background="@drawable/job" />

    <RelativeLayout
        android:id="@+id/newsl"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/cloth">
        <ImageButton
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:id="@+id/newsimone"
            android:layout_alignParentTop="true"
            android:layout_marginBottom="5dp"

            android:padding="5dp"
            android:background="@drawable/job" />
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="100dp"
            android:layout_toRightOf="@id/newsimone"/>
    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/newsl2"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/newsl">
        <ImageButton
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:id="@+id/newsimtwo"
            android:layout_alignParentTop="true"
            android:layout_marginBottom="5dp"

            android:padding="5dp"
            android:background="@drawable/job" />
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="100dp"
            android:layout_toRightOf="@id/newsimtwo"/>
    </RelativeLayout>
    <RelativeLayout
        android:id="@+id/catl"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/newsl2"
        android:layout_marginBottom="5dp">
        <View android:id="@+id/strut"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_alignParentLeft="true"
            android:layout_margin="1dp"/>
        <View android:id="@+id/strut2"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_alignParentRight="true"
            android:layout_margin="1dp"/>
        <FrameLayout android:id="@+id/elo"
            android:layout_toRightOf="@id/strut"
            android:layout_toLeftOf="@id/strut2"
            android:layout_width="fill_parent"      android:layout_height="wrap_content"
            android:background="@drawable/cell_shape"     android:visibility="gone">
            <ExpandableListView
                android:id="@+id/eloc"
                android:layout_width="fill_parent"
                android:layout_height="30dp"
                android:layout_toRightOf="@id/strut"
                android:layout_toLeftOf="@id/strut2"
                android:background="@color/al"
                android:layout_margin="2dp"></ExpandableListView>
        </FrameLayout>
        <FrameLayout android:id="@+id/elf"
            android:layout_toRightOf="@id/strut"
            android:layout_toLeftOf="@id/strut2"
            android:layout_below="@id/eloc"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:background="@drawable/cell_shape" android:visibility="gone">
            <ExpandableListView
                android:id="@+id/elfc"
                android:layout_margin="2dp"

                android:layout_width="fill_parent"
                android:layout_height="30dp"
                android:layout_toRightOf="@id/strut"
                android:layout_toLeftOf="@id/strut2"
                android:background="@color/bl"></ExpandableListView>
        </FrameLayout>
        <FrameLayout android:id="@+id/ele"
            android:layout_toRightOf="@id/strut"
            android:layout_toLeftOf="@id/strut2"
            android:layout_below="@id/elfoodc"
            android:layout_width="fill_parent"  android:layout_height="wrap_content"
            android:background="@drawable/cell_shape" android:visibility="gone">
            <ExpandableListView
                android:id="@+id/elec"
                android:layout_margin="2dp"
                android:layout_toRightOf="@id/strut"
                android:layout_toLeftOf="@id/strut2"
                android:layout_width="fill_parent"
                android:layout_height="30dp"
                android:background="@color/bg"></ExpandableListView>
        </FrameLayout>
        <FrameLayout android:id="@+id/elg"
            android:layout_toRightOf="@id/strut"
            android:layout_toLeftOf="@id/strut2"
            android:layout_below="@id/elec"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:background="@drawable/cell_shape" android:visibility="gone">

            <ExpandableListView
                android:id="@+id/elgc"
                android:layout_margin="2dp"
                android:layout_width="fill_parent"
                android:layout_height="30dp"
                android:layout_toRightOf="@id/strut"
                android:layout_toLeftOf="@id/strut2"
                android:background="@color/bla"></ExpandableListView>
        </FrameLayout>
        <FrameLayout android:id="@+id/elco"
            android:layout_toRightOf="@id/strut"
            android:layout_toLeftOf="@id/strut2"
            android:layout_below="@id/eleduc"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:background="@drawable/cell_shape" android:visibility="gone">
            <ExpandableListView
                android:id="@+id/elcoc"
                android:layout_margin="2dp"
                android:layout_width="fill_parent"
                android:layout_height="30dp"
                android:layout_toRightOf="@id/strut"
                android:layout_toLeftOf="@id/strut2"
                android:background="@color/r"></ExpandableListView>
        </FrameLayout>


    </RelativeLayout>

    <TextView
        android:layout_below="@id/catl"
        android:layout_width="match_parent"
        android:layout_height="70dp"
        android:background="@color/dg"
        android:gravity="center"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true"
        android:textColor="@color/wh"
        android:textStyle="bold"
        android:textSize="30sp"/>

</RelativeLayout></ScrollView>
 </LinearLayout>


<ListView
android:id="@+id/listview_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#111"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="1dp" />

</android.support.v4.widget.DrawerLayout>