level 7
private DrawerLayout mDrawLayout;
private ActionBarDrawerToggle mDrawerToggle;
private CharSequence mDrawerTitle, mTitle;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setTheme(android.R.style.Theme_Holo);
mDrawerTitle = mTitle = this.getTitle();
InitView();
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawLayout, R.drawable.ic_drawer,R.string.drawer_open,R.string.drawer_close)
{
@Override
public void onDrawerClosed(View drawerView)
{
}
@Override
public void onDrawerOpened(View drawerView)
{
}
};
mDrawLayout.setDrawerListener(mDrawerToggle);
}
static {
System.loadLibrary("myeditor");
}
private void InitView()
{
mDrawLayout = (DrawerLayout)findViewById(R.id.drawerlayout);
}
2016年02月21日 06点02分
2
level 7
不用actiondrawertoggle直接setDrawerListener重写3个方法也是闪退
2016年02月21日 06点02分
3
level 14
mDrawLayout是null
| ू•ૅω•́)ᵎᵎᵎ
2016年02月21日 10点02分
5
findviewbyid不行吗
2016年02月21日 12点02分
@傻子的_love 我拿了个Demo改了下 是不是我用ndk没设置好的原因呢 虽然我ndk的那部分还没动
2016年02月21日 12点02分
level 1
08-28 05:02:46.166 9245-9245/? I/.myapplication: Not late-enabling -Xcheck:jni (already on)
08-28 05:02:46.246 9245-9245/? W/.myapplication: Unexpected CPU variant for X86 using defaults: x86
08-28 05:02:46.381 9245-9245/com.example.hp.myapplication4 I/.myapplication: The ClassLoaderContext is a special shared library.
08-28 05:02:46.549 9245-9245/com.example.hp.myapplication4 W/.myapplication: JIT profile information will not be recorded: profile file does not exits.
08-28 05:02:46.552 9245-9245/com.example.hp.myapplication4 I/chatty: uid=10087(com.example.hp.myapplication4) identical 9 lines
08-28 05:02:46.552 9245-9245/com.example.hp.myapplication4 W/.myapplication: JIT profile information will not be recorded: profile file does not exits.
08-28 05:02:46.570 9245-9245/com.example.hp.myapplication4 I/InstantRun: starting instant run server: is main process
08-28 05:02:46.728 9245-9245/com.example.hp.myapplication4 W/.myapplication: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
08-28 05:02:46.729 9245-9245/com.example.hp.myapplication4 W/.myapplication: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
08-28 05:02:46.805 9245-9245/com.example.hp.myapplication4 D/OpenGLRenderer: Skia GL Pipeline
08-28 05:02:46.861 9245-9264/com.example.hp.myapplication4 I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
08-28 05:02:46.861 9245-9264/com.example.hp.myapplication4 I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
08-28 05:02:46.861 9245-9264/com.example.hp.myapplication4 I/OpenGLRenderer: Initialized EGL, version 1.4
08-28 05:02:46.861 9245-9264/com.example.hp.myapplication4 D/OpenGLRenderer: Swap behavior 1
08-28 05:02:46.861 9245-9264/com.example.hp.myapplication4 W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
08-28 05:02:46.861 9245-9264/com.example.hp.myapplication4 D/OpenGLRenderer: Swap behavior 0
08-28 05:02:46.875 9245-9264/com.example.hp.myapplication4 D/EGL_emulation: eglCreateContext: 0xe1d05300: maj 3 min 1 rcv 4
08-28 05:02:46.918 9245-9264/com.example.hp.myapplication4 D/EGL_emulation: eglMakeCurrent: 0xe1d05300: ver 3 1 (tinfo 0xe1d03680)
08-28 05:02:46.924 9245-9264/com.example.hp.myapplication4 E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
08-28 05:02:46.924 9245-9264/com.example.hp.myapplication4 E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
08-28 05:02:47.111 9245-9264/com.example.hp.myapplication4 D/EGL_emulation: eglMakeCurrent: 0xe1d05300: ver 3 1 (tinfo 0xe1d03680) 求大神解答 这是错误日志 我也是打开侧滑栏闪退
2018年08月28日 05点08分
7
level 1
public void initLayout() {
drawerLayout = (DrawerLayout) findViewById(R.id.main_drawer_layout);
//左边菜单
main_left_drawer_layout = (RelativeLayout) findViewById(R.id.main_left_drawer_layout);
}
private void initEvent() {
drawerbar = new ActionBarDrawerToggle(this, drawerLayout, 1, 2) {
//菜单打开
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
}
// 菜单关闭
public void onDrawerClosed(View drawerView) {
super.onDrawerClosed(drawerView);
}
};
drawerLayout.setDrawerListener(drawerbar);
} 附上代码
2018年08月28日 05点08分
8