问题描述
以下是错误:
二月2日至14日:00:55.663 907-907 / com.wlodsgn.bunbunup E / AndroidRuntime:致命异常:主要
工艺:com.wlodsgn.bunbunup,PID:907
了java.lang.RuntimeException:无法启动活动ComponentInfo {com.wlodsgn.bunbunup / com.wlodsgn.bunbunup.MenuActivity}:显示java.lang.NullPointerException
在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
在android.app.ActivityThread.access $ 800(ActivityThread.java:135)
在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1196)
在android.os.Handler.dispatchMessage(Handler.java:102)
在android.os.Looper.loop(Looper.java:136)
在android.app.ActivityThread.main(ActivityThread.java:5017)
在java.lang.reflect.Method.invokeNative(本机方法)
在java.lang.reflect.Method.invoke(Method.java:515)
在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:779)
在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
在dalvik.system.NativeStart.main(本机方法)
显示java.lang.NullPointerException:产生的原因
在com.wlodsgn.bunbunup.MenuActivity.onCreate(MenuActivity.java:81)
在android.app.Activity.performCreate(Activity.java:5231)
在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
在android.app.ActivityThread.access $ 800(ActivityThread.java:135)
在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1196)
在android.os.Handler.dispatchMessage(Handler.java:102)
在android.os.Looper.loop(Looper.java:136)
在android.app.ActivityThread.main(ActivityThread.java:5017)
在java.lang.reflect.Method.invokeNative(本机方法)
在java.lang.reflect.Method.invoke(Method.java:515)
在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:779)
在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
在dalvik.system.NativeStart.main(本机方法)
二月2日至14日:01:01.643 907-907 / com.wlodsgn.bunbunup I /工艺:发送信号。 PID:907 SIG:9
我严重不知道可能是什么问题,花了几个小时,试图寻找一个解决方案,但它仍然会崩溃。我们的想法是让我的第一个主要活动(IntroActivity.java)打开导航抽屉另一个活动(menuactivity.java)。任何帮助将大大AP preciated。
下面是IntroActivity.java:
进口android.app.Activity;
进口android.content.Intent;
进口android.support.v7.app.ActionBarActivity;
进口android.os.Bundle;
进口android.util.Log;
进口android.view.Menu;
进口android.view.MenuItem;
进口android.view.View;/ **
*创建者威乐在2015年2月13日。
* /
公共类IntroActivity延伸活动{ @覆盖
保护无效的onCreate(捆绑savedInstanceState){
super.onCreate(savedInstanceState);
的setContentView(R.layout.activity_intro);
Log.i(BunBunUp,MainActivity创建);
}
@覆盖
公共布尔onCreateOptionsMenu(菜单菜单){
//充气菜单;如果是present这增加了项目操作栏。
。getMenuInflater()膨胀(R.menu.menu_intro,菜单);
返回true;
} @覆盖
公共布尔onOptionsItemSelected(菜单项项){
//处理动作栏项目点击这里。操作栏会
//自动处理上点击主页/向上按钮,只要
//你在AndroidManifest.xml中指定一个父活动。
INT ID = item.getItemId(); // noinspection SimplifiableIfStatement
如果(ID == R.id.action_settings){
返回true;
} 返回super.onOptionsItemSelected(项目);
} 公共无效startMenuActivity(视图v){
意向意图=新意图(IntroActivity.this,MenuActivity.class);
startActivity(意向);
} 保护无效onResume(){
super.onResume();
Log.i(BunBunUp,IntroActivity续);
} 保护无效的onPause(){
super.onPause();
Log.i(BunBunUp,IntroActivity暂停);
} 保护无效的onStop(){
super.onStop();
Log.i(BunBunUp,IntroActivity停止);
}
}
下面是MenuActivity.java:
进口的java.util.ArrayList;进口android.app.Activity;
进口android.app.Fragment;
进口android.app.FragmentManager;
进口android.content.res.Configuration;
进口android.content.res.TypedArray;
进口android.os.Bundle;
进口android.support.v4.app.ActionBarDrawerToggle;
进口android.support.v4.widget.DrawerLayout;
进口android.util.Log;
进口android.view.Menu;
进口android.view.MenuItem;
进口android.view.View;
进口android.widget.AdapterView;
进口android.widget.ListView;/ **
*创建者威乐在2015年2月13日。
* /
公共类MenuActivity延伸活动{
私人DrawerLayout mDrawerLayout;
私人的ListView mDrawerList;
私人ActionBarDrawerToggle mDrawerToggle; //导航抽屉称号
私人CharSequence的mDrawerTitle; //用于存储应用程序标题
私人CharSequence的mTitle; //滑动菜单项
私有String [] navMenuTitles;
私人TypedArray navMenuIcons; 私人的ArrayList< NavDrawerItem> navDrawerItems;
私人NavDrawerListAdapter适配器; @覆盖
保护无效的onCreate(捆绑savedInstanceState){
super.onCreate(savedInstanceState);
的setContentView(R.layout.activity_menu); mTitle = mDrawerTitle =的getTitle(); //负荷滑动菜单项
navMenuTitles = getResources()getStringArray(R.array.nav_drawer_items)。 从资源//导航抽屉图标
navMenuIcons = getResources()
.obtainTypedArray(R.array.nav_drawer_icons); mDrawerLayout =(DrawerLayout)findViewById(R.id.drawer_layout);
mDrawerList =(ListView控件)findViewById(R.id.list_slidermenu); navDrawerItems =新的ArrayList< NavDrawerItem>(); // agregar联合国NUEVO项人菜单deslizante
// Favoritos
navDrawerItems.add(新NavDrawerItem(navMenuTitles [0],navMenuIcons.getResourceId(0,-1)));
// Pedidos
navDrawerItems.add(新NavDrawerItem(navMenuTitles [1],navMenuIcons.getResourceId(1,-1)));
// Catologo
//navDrawerItems.add(new NavDrawerItem(navMenuTitles [2],navMenuIcons.getResourceId(2,-1),真的,Estrenos));
// CONTACTO
//navDrawerItems.add(new NavDrawerItem(navMenuTitles [3],navMenuIcons.getResourceId(3,-1))); //回收类型数组
navMenuIcons.recycle(); mDrawerList.setOnItemClickListener(新SlideMenuClickListener()); //设置导航抽屉名单适配器
适配器=新NavDrawerListAdapter(getApplicationContext()
navDrawerItems);
mDrawerList.setAdapter(适配器); //使操作栏中的应用程序图标和行为作为切换按钮
getActionBar()setDisplayHomeAsUpEnabled(真)。
getActionBar()setHomeButtonEnabled(真)。 mDrawerToggle =新ActionBarDrawerToggle(这一点,mDrawerLayout,
R.drawable.ic_drawer,//导航菜单切换图标
R.string.app_name,//导航抽屉打开 - 描述的可访问性
R.string.app_name //导航抽屉接近 - 描述的可访问性
){
公共无效onDrawerClosed(查看视图){
。getActionBar()的setTitle(mTitle);
//调用prepareOptionsMenu()来显示操作栏图标
invalidateOptionsMenu();
} 公共无效onDrawerOpened(查看drawerView){
。getActionBar()的setTitle(mDrawerTitle);
//调用prepareOptionsMenu()隐藏操作栏图标
invalidateOptionsMenu();
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle); 如果(savedInstanceState == NULL){
//对第一个项目的资产净值首次显示视图
displayView(0);
}
} / **
*滑动菜单项,点击监听器
* * /
私有类SlideMenuClickListener工具
ListView.OnItemClickListener {
@覆盖
公共无效onItemClick(适配器视图<>母公司,观景,INT位置,
长ID){
//选定导航抽屉项显示视图
displayView(位置);
}
} @覆盖
公共布尔onCreateOptionsMenu(菜单菜单){
。getMenuInflater()膨胀(R.menu.menu,菜单);
返回true;
} @覆盖
公共布尔onOptionsItemSelected(菜单项项){
//切换上选择操作栏中的应用程序图标/标题导航抽屉
如果(mDrawerToggle.onOptionsItemSelected(项目)){
返回true;
}
//处理操作栏中点击动作
开关(item.getItemId()){
案例R.id.action_settings:
返回true;
默认:
返回super.onOptionsItemSelected(项目);
}
} / * *
*时调用invalidateOptionsMenu()被触发
* /
@覆盖
prepareOptionsMenu(菜单菜单)上公共布尔{
//如果导航抽屉被打开,隐藏行动项目
布尔drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);
menu.findItem(R.id.action_settings).setVisible(drawerOpen!);
返回super.on prepareOptionsMenu(菜单);
} / **
所选导航抽屉列表项* Diplaying片段视图
* * /
私人无效displayView(INT位置){
//更新替换片段的主要内容
片段片段= NULL;
开关(位置){
情况下0:
片段=新FmMenu();
打破;
情况1:
片段=新FmContacto();
打破; 默认:
打破;
} 如果(片段!= NULL){
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.frame_container,片段).commit(); //更新所选项目和标题,然后关上抽屉
mDrawerList.setItemChecked(位置,真正的);
mDrawerList.setSelection(位置);
(navMenuTitles [位置])的setTitle;
mDrawerLayout.closeDrawer(mDrawerList);
}其他{
//错误创建片段
Log.e(拉米罗,MainActivity - 错误本身宽多克里奥EL片段);
}
} @覆盖
公共无效的setTitle(CharSequence的标题){
mTitle =称号;
。getActionBar()的setTitle(mTitle);
} / **
*当使用ActionBarDrawerToggle,你必须在调用它
* onPostCreate()和onConfigurationChanged()...
* / @覆盖
保护无效onPostCreate(捆绑savedInstanceState){
super.onPostCreate(savedInstanceState);
//同步onRestoreInstanceState后切换状态已经发生。
mDrawerToggle.syncState();
} @覆盖
公共无效onConfigurationChanged(配置NEWCONFIG){
super.onConfigurationChanged(NEWCONFIG);
//把任何配置更改抽屉toggls
mDrawerToggle.onConfigurationChanged(NEWCONFIG);
在回应西蒙的问题,这是我调试的结果:
而这些变量的结果:
此= {} com.wlodsgn.bunbunup.MenuActivity@831912707472
适配器= {} com.wlodsgn.bunbunup.NavDrawerListAdapter@831912476752
mDrawerLayout = {android.support.v4.widget.DrawerLayout@831912722552}\"android.support.v4.widget.DrawerLayout{b1dcc078 VFE ..... ......我。 0,0-0,0#7f090042应用:ID / drawer_layout}
mDrawerList = {} [email protected] {b1dd86e8 VFED.VC. ......我0,0-0,0#7f090044应用:ID / list_slidermenu}
mDrawerTitle = {} java.lang.String@831912705496菜单
mDrawerToggle = NULL
mTitle = {} java.lang.String@831912705496菜单
navDrawerItems = {} java.util.ArrayList@831912670472大小= 2
navMenuIcons = {android.content.res.TypedArray@831912712688}[3,77,2,2130837561,0,160,3,73,2,2130837559,0,160,3,72,2,2130837560,0,160 ,3,76,2,2130837556,0,160,0,0,-1,0,0,0,0,0,-1,0,0,0,0,0,-1,0,0, 0,0,0,-1,0,0,0,0,0,-1,0,0,0,0,0,-1,0,0,0,0,0,-1,0, 0,0,...
navMenuTitles = {java.lang.String中[4] @ 831912431488}
mActionBar = NULL
mActivityInfo = {} android.content.pm.ActivityInfo@831912705176ActivityInfo {b1dc7c98 com.wlodsgn.bunbunup.MenuActivity}
mAllLoaderManagers = NULL
mApplication = {} android.app.Application@831912467056
mWindowManager = {} android.view.WindowManagerImpl@831912710184
mWindow = {} com.android.internal.policy.impl.PhoneWindow@831912708664
mUiThread = {} java.lang.Thread@831908953256线程[为主,5,主]
mTranslucentCallback = NULL
mComponent = {android.content.ComponentName@831912704936}\"ComponentInfo{com.wlodsgn.bunbunup/com.wlodsgn.bunbunup.MenuActivity}\"
mToken = {} android.os.BinderProxy@831912705080
mContainer = {} android.app.Activity$1@831912707880
mCurrentConfig = {} android.content.res.Configuration@831912708528{1.0 310mcc260mnc EN_US ldltr sw360dp w360dp h567dp 480dpi NRML端口手指QWERTY / V / V -nav /小时补5}
mDecor = NULL
mTitle = {} java.lang.String@831912705496菜单
mDefaultKeySsb = NULL
mSearchManager = NULL
mResultData = NULL
mEmbeddedID = NULL
mParent = NULL
mMenuInflater = NULL
mFragments = {} android.app.FragmentManagerImpl@831912707760FragmentManager在{{MenuActivity} b1dc8590} b1dc86b0
mHandler = {} android.os.Handler@831912708008处理器(android.os.Handler){} b1dc87a8
mManagedDialogs = NULL
mInstanceTracker = {} android.os.StrictMode$InstanceTracker@831912707920
mInstrumentation = {} android.app.Instrumentation@831912463176
mIntent = {} android.content.Intent@831912704784意向{CMP = com.wlodsgn.bunbunup / .MenuActivity}
mLastNonConfigurationInstances = NULL
mLoaderManager = NULL
mManagedCursors = {} java.util.ArrayList@831912707896大小= 0
mMainThread = {} android.app.ActivityThread@831912436760
mLoadersStarted = FALSE
mIdent = -1308749784
mFinished = FALSE
mEnableDefaultActionBarUp = FALSE
mResult code = 0
mDoReportFullyDrawn =真
mResumed = FALSE
mDestroyed = FALSE
mStartedActivity = FALSE
mStopped = FALSE
mTemporaryPause = FALSE
mDefaultKeyMode = 0
mTitleColor = 0
mTitleReady = FALSE
mConfigChangeFlags = 0
mCheckedForLoaderManager = FALSE
mChangingConfigurations = FALSE
mVisibleFromClient =真
mVisibleFromServer = FALSE
mChangeCanvasToTranslucent = FALSE
mWindowAdded = FALSE
mCalled =真
MBASE = {} android.app.ContextImpl@831912708040
mInflater = {} com.android.internal.policy.impl.PhoneLayoutInflater@831912709768
mOverrideConfiguration = NULL
mResources = {} android.content.res.Resources@831912458488
mTheme = {} android.content.res.Resources$Theme@831912710208
mThemeResource = 2131492864
MBASE = {} android.app.ContextImpl@831912708040
savedInstanceState = NULL
mDrawerList = {} [email protected] {b1dd86e8 VFED.VC. ......我0,0-0,0#7f090044应用:ID / list_slidermenu}
MTEM $ P $厘= {android.graphics.Rect@831912490576}矩形(0,0 - 0,0)
mArrowScrollFocusResult = {} android.widget.ListView$ArrowScrollFocusResult@831912688680
mDivider = {} android.graphics.drawable.ColorDrawable@831912513672
mOverScrollHeader = NULL
mOverScrollFooter = NULL
mDividerPaint = NULL
mFocusSelector = NULL
mHeaderViewInfos = {} java.util.ArrayList@831912694584大小= 0
mFooterViewInfos = {} java.util.ArrayList@831912689696大小= 0
mHeaderDividersEnabled =真
mFooterDividersEnabled =真
mIsCacheColorOpaque = FALSE
mItemsCanFocus = FALSE
mDividerIsOpaque =真
mDividerHeight = 3
mAreAllItemsSelectable =真
mAccessibilityDelegate = NULL
mVelocityTracker = NULL
mAdapter = {} com.wlodsgn.bunbunup.NavDrawerListAdapter@831912476752
mTouchModeReset = NULL
mTouchFrame = NULL
mTextFilter = NULL
mSelectorRect = {android.graphics.Rect@831912543968}矩形(0,0 - 0,0)
mCheckStates = {} android.util.SparseBooleanArray@831912575600{}
mCheckedIdStates = NULL
mSelector = {} android.graphics.drawable.StateListDrawable@831912745608
mChoiceActionMode = NULL
mScrollUp = NULL
mClearScrollingCache = NULL
mContextMenuInfo = NULL
mDataSetObserver = {} android.widget.AbsListView$AdapterDataSetObserver@831912473520
mDefInputConnection = NULL
mScrollStrictSpan = NULL
mScrollDown = NULL
mRemoteAdapter = NULL
mRecycler = {} android.widget.AbsListView$RecycleBin@831912464376
mEdgeGlowBottom = {} android.widget.EdgeEffect@831912768272
mEdgeGlowTop = {} android.widget.EdgeEffect@831912774568
mPublicInputConnection = NULL
mPositionScroller = NULL
mFastScroller = NULL
mPositionScrollAfterLayout = NULL
mPopup = NULL
mPerformClick = NULL
mFlingRunnable = NULL
mFlingStrictSpan = NULL
mPendingSync = NULL
mPendingCheckForTap = NULL
mPendingCheckForLong preSS = NULL
mPendingCheckForKeyLong preSS = NULL
mOwnerThread = {} java.lang.Thread@831908953256线程[为主,5,主]
mIsScrap = {布尔[1] @ 831912700520}
mOnScrollListener = NULL
mMultiChoiceModeCallback = NULL
mListPadding = {android.graphics.Rect@831912509624}矩形(0,0 - 0,0)
mLastPositionDistanceGuess = 0
mLastScrollState = 0
mLastTouchMode = -1
mLastY = 0
mLayoutMode = 0
mLastHandledItemCount = 0
mMaximumVelocity = 24000
mMinimumVelocity = 150
mMotionCorrection = 0
mMotionPosition = 0
mMotionViewNewTop = 0
mMotionViewOriginalTop = 0
mMotionX = 0
mMotionY = 0
mLastAccessibilityScrollEventToIndex = 0
mLastAccessibilityScrollEventFromIndex = 0
mOverflingDistance = 18
mOverscrollDistance = 0
mOverscrollMax = 0
mIsChildViewEnabled = FALSE
mGlowPaddingRight = 0
mGlowPaddingLeft = 0
mGlobalLayoutListenerAddedFilter = FALSE
mForceTranscriptScroll = FALSE
mFlingProfilingStarted = FALSE
mFirstPositionDistanceGuess = 0
mPopupHidden = FALSE
mFiltered = FALSE
mFastScrollEnabled = FALSE
mFastScrollAlwaysVisible = FALSE
mDrawSelectorOnTop = FALSE
mDirection = 0
mResurrectToPosition = -1
mDensityScale = 3.0
mScrollProfilingStarted = FALSE
mDeferNotifyDataSetChanged = FALSE
mChoiceMode = 1
mScrollingCacheEnabled =真
mSelectedTop = 0
mSelectionBottomPadding = 0
mSelectionLeftPadding = 0
mSelectionRightPadding = 0
mSelectionTopPadding = 0
mCheckedItemCount = 0
mSelectorPosition = -1
mCachingStarted = FALSE
mSmoothScrollbarEnabled =真
mStackFromBottom = FALSE
mCachingActive = FALSE
mTextFilterEnabled = FALSE
mCacheColorHint = 0
mTouchMode = -1
mAdapterHasStableIds = FALSE
mTouchSlop = 24
mTranscriptMode = 0
mVelocityScale = 1.0
mActivePointerId = -1
mWidthMeasureSpec = 0
mSelectionNotifier = NULL
mOnItemSelectedListener = NULL
mOnItemLongClickListener = NULL
mOnItemClickListener = {} com.wlodsgn.bunbunup.MenuActivity$SlideMenuClickListener@831912422512
mEmptyView = NULL
mSyncRowId = -9223372036854775808
mSyncHeight = 0
mSelectedRowId = -9223372036854775808
mOldSelectedRowId = -9223372036854775808
mNextSelectedRowId = -9223372036854775808
mNextSelectedPosition = -1
mNeedSync = FALSE
mOldItemCount = 0
mOldSelectedPosition = -1
mLayoutHeight = 0
mDesiredFocusableState =真
mDesiredFocusableInTouchModeState =真
mDataChanged = FALSE
mSelectedPosition = -1
mItemCount = 2
mBlockLayoutRequests = FALSE
mSpecificTop = 0
mInLayout = FALSE
mSyncMode = 0
mSyncPosition = 0
mFirstPosition = 0
mAnimationListener = NULL
mCachePaint = NULL
mVisibilityChangingChildren = NULL
mTransitioningViews = NULL
mChildTransformation = NULL
mChildren = {android.view.View [12] @ 831912500288}
mTransition = NULL
mCurrentDrag = NULL
mCurrentDragView = NULL
mDisappearingChildren = NULL
mDragNotifiedChildren = NULL
mFirstHoverTarget = NULL
mFirstTouchTarget = NULL
mFocused = NULL
mOnHierarchyChangeListener = NULL
mLocalPoint = NULL
mInvalidateRegion = NULL
mInvalidationTransformation = NULL
mLayoutTransitionListener = {} android.view.ViewGroup$3@831912441104
mLayoutAnimationController = NULL
mLastTouchDownX = 0.0
mLastTouchDownTime = 0
mLastTouchDownY = 0.0
mLayoutCalledWhileSup pressed = FALSE
mLayoutMode = -1
mLastTouchDownIndex = -1
mHoveredSelf = FALSE
mGroupFlags = 2228307
mPersistentDrawingCache = 2
MSUP pressLayout = FALSE
mChildrenCount = 0
mChildCountWithTransientState = 0
mChildAcceptsDrag = FALSE
mUnset pressedState = NULL
mAccessibilityDelegate = NULL
mUnscaledDrawingCache = NULL
mAnimator = NULL
mAttachInfo = NULL
mBackground = {} android.graphics.drawable.ColorDrawable@831912688536
mTransformationInfo = NULL
mTouchDelegate = NULL
MTAG = NULL
mSendViewStateChangedAccessibilityEvent = NULL
mClipBounds = NULL
mContentDescription = NULL
mContext = {} com.wlodsgn.bunbunup.MenuActivity@831912707472
mCurrentAnimation = NULL
mDisplayList = NULL
mDrawableState = NULL
mDrawingCache = NULL
mSendViewScrolledAccessibilityEvent = NULL
mFloatingTreeObserver = NULL
mHardwareLayer = NULL
mScrollCache = {} android.view.View$ScrollabilityCache@831912606240
mResources = {} android.content.res.Resources@831912458488
mInputEventConsistencyVerifier = {} android.view.InputEventConsistencyVerifier@831912774440
mKeyedTags = NULL
mPerformClick = NULL
mPendingCheckForTap = NULL
mLayerPaint = NULL
mPendingCheckForLong preSS = NULL
mLayoutInsets = NULL
mLayoutParams = {} android.support.v4.widget.DrawerLayout$LayoutParams@831912431416
mParent = {android.support.v4.widget.DrawerLayout@831912722552}\"android.support.v4.widget.DrawerLayout{b1dcc078 VFE ..... ......我。 0,0-0,0#7f090042应用:ID / drawer_layout}
mOverlay = NULL
mListenerInfo = NULL
mLocalDirtyRect = NULL
mMatchId predicate = NULL
mMatchLabelFor predicate = NULL
mMeasureCache = NULL
mMeasuredHeight = 0
mMeasuredWidth = 0
mMinHeight = 0
mMinWidth = 0
mNextFocusDownId = -1
mNextFocusForwardId = -1
mNextFocusLeftId = -1
mNextFocusRightId = -1
mNextFocusUpId = -1
mOldHeightMeasureSpec = -2147483648
mOldWidthMeasureSpec = -2147483648
mOverScrollMode = 1
mLeftPaddingDefined = FALSE
mPaddingBottom = 0
mPaddingLeft = 0
mPaddingRight = 0
mPaddingTop = 0
MLEFT = 0
mLayerType = 0
mLastIsOpaque = FALSE
mLabelForId = -1
mPrivateFlags = -2121789184
mPrivateFlags2 = 4334600
mPrivateFlags3 = 0
mRecreateDisplayList = FALSE
MID = 2131296324
mRight = 0
mRightPaddingDefined = FALSE
mHasPerformedLong preSS = FALSE
mScrollX = 0
mScrollY = 0
mDrawingCacheBackgroundColor = 0
mCachingFailed = FALSE
mSendingHoverAccessibilityEvents = FALSE
mSystemUiVisibility = 0
mBottom = 0
mTop = 0
mBackgroundSizeChanged =真
mTouchSlop = 24
mBackgroundResource = 0
mTransientStateCount = 0
mAccessibilityViewId = -1
mAccessibilityCursorPosition = -1
mUserPaddingBottom = 0
mUserPaddingEnd = -2147483648
mUserPaddingLeft = 0
mUserPaddingLeftInitial = 0
mUserPaddingRight = 0
mUserPaddingRightInitial = 0
mUserPaddingStart = -2147483648
mVerticalScrollFactor = 0.0
mVerticalScrollbarPosition = 0
mViewFlags = 402932225
mWindowAttachCount = 0
适配器= {} com.wlodsgn.bunbunup.NavDrawerListAdapter@831912476752
上下文= {} android.app.Application@831912467056
navDrawerItems = {} java.util.ArrayList@831912670472大小= 2
mDataSetObservable = {} android.database.DataSetObservable@831912431560
mDrawerToggle = NULL
现在,当我在做一步,这是结果:
调试变做了注释部分发布,因为他们都不让我增加超过2链接跨距后的结果。
如果您需要从调试子变量的信息,让我知道
至于goonerandroid的要求,这里是我的styles.xml code:的
<资源> <! - Base应用程序的主题。 - >
<样式名称=AppTheme父=Theme.AppCompat.Light.DarkActionBar>
<! - 在这里自定义的主题。 - >
< /风格>< /资源>
试着改变你的主题此
<样式名称=AppTheme父=机器人:Theme.Holo.Light.DarkActionBar>
而不是应用程序兼容性Version.It基本上取决于界河API你是targeting.If它小于14使用
<样式名称=AppTheme父=Theme.AppCompat.Light.DarkActionBar>
和您的活动调用使用此您的动作条
getSupportActionBar()setDisplayHomeAsUpEnabled(真)。
Here is the error:
02-14 02:00:55.663 907-907/com.wlodsgn.bunbunup E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.wlodsgn.bunbunup, PID: 907
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wlodsgn.bunbunup/com.wlodsgn.bunbunup.MenuActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.wlodsgn.bunbunup.MenuActivity.onCreate(MenuActivity.java:81)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
02-14 02:01:01.643 907-907/com.wlodsgn.bunbunup I/Process﹕ Sending signal. PID: 907 SIG: 9
I seriously have no idea what might be the problem, spent couple of hours trying to look for a solution but it is still crashing. The idea is to make my first main activity (IntroActivity.java) open another activity(menuactivity.java) with navigation drawer. Any help would be greatly appreciated.
Here is IntroActivity.java:
import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
/**
* Created by WiLo on 2/13/2015.
*/
public class IntroActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_intro);
Log.i("BunBunUp", "MainActivity Created");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_intro, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
public void startMenuActivity(View v){
Intent intent = new Intent(IntroActivity.this, MenuActivity.class);
startActivity(intent);
}
protected void onResume(){
super.onResume();
Log.i("BunBunUp", "IntroActivity Resumed");
}
protected void onPause(){
super.onPause();
Log.i("BunBunUp", "IntroActivity Paused");
}
protected void onStop(){
super.onStop();
Log.i("BunBunUp", "IntroActivity Stopped");
}
}
Here is MenuActivity.java:
import java.util.ArrayList;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.widget.DrawerLayout;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
/**
* Created by WiLo on 2/13/2015.
*/
public class MenuActivity extends Activity {
private DrawerLayout mDrawerLayout;
private ListView mDrawerList;
private ActionBarDrawerToggle mDrawerToggle;
// nav drawer title
private CharSequence mDrawerTitle;
// used to store app title
private CharSequence mTitle;
// slide menu items
private String[] navMenuTitles;
private TypedArray navMenuIcons;
private ArrayList<NavDrawerItem> navDrawerItems;
private NavDrawerListAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_menu);
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_layout);
mDrawerList = (ListView) findViewById(R.id.list_slidermenu);
navDrawerItems = new ArrayList<NavDrawerItem>();
// agregar un nuevo item al menu deslizante
// Favoritos
navDrawerItems.add(new NavDrawerItem(navMenuTitles[0], navMenuIcons.getResourceId(0, -1)));
// Pedidos
navDrawerItems.add(new NavDrawerItem(navMenuTitles[1], navMenuIcons.getResourceId(1, -1)));
// Catologo
//navDrawerItems.add(new NavDrawerItem(navMenuTitles[2], navMenuIcons.getResourceId(2, -1), true, "Estrenos"));
// Contacto
//navDrawerItems.add(new NavDrawerItem(navMenuTitles[3], navMenuIcons.getResourceId(3, -1)));
// Recycle the typed array
navMenuIcons.recycle();
mDrawerList.setOnItemClickListener(new SlideMenuClickListener());
// setting the nav drawer list adapter
adapter = new NavDrawerListAdapter(getApplicationContext(),
navDrawerItems);
mDrawerList.setAdapter(adapter);
// enabling action bar app icon and behaving it as toggle button
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
R.drawable.ic_drawer, //nav menu toggle icon
R.string.app_name, // nav drawer open - description for accessibility
R.string.app_name // nav drawer close - description for accessibility
) {
public void onDrawerClosed(View view) {
getActionBar().setTitle(mTitle);
// calling onPrepareOptionsMenu() to show action bar icons
invalidateOptionsMenu();
}
public void onDrawerOpened(View drawerView) {
getActionBar().setTitle(mDrawerTitle);
// calling onPrepareOptionsMenu() to hide action bar icons
invalidateOptionsMenu();
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
if (savedInstanceState == null) {
// on first time display view for first nav item
displayView(0);
}
}
/**
* Slide menu item click listener
* */
private class SlideMenuClickListener implements
ListView.OnItemClickListener {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
// display view for selected nav drawer item
displayView(position);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// toggle nav drawer on selecting action bar app icon/title
if (mDrawerToggle.onOptionsItemSelected(item)) {
return true;
}
// Handle action bar actions click
switch (item.getItemId()) {
case R.id.action_settings:
return true;
default:
return super.onOptionsItemSelected(item);
}
}
/* *
* Called when invalidateOptionsMenu() is triggered
*/
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
// if nav drawer is opened, hide the action items
boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);
menu.findItem(R.id.action_settings).setVisible(!drawerOpen);
return super.onPrepareOptionsMenu(menu);
}
/**
* Diplaying fragment view for selected nav drawer list item
* */
private void displayView(int position) {
// update the main content by replacing fragments
Fragment fragment = null;
switch (position) {
case 0:
fragment = new FmMenu();
break;
case 1:
fragment = new FmContacto();
break;
default:
break;
}
if (fragment != null) {
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.frame_container, fragment).commit();
// update selected item and title, then close the drawer
mDrawerList.setItemChecked(position, true);
mDrawerList.setSelection(position);
setTitle(navMenuTitles[position]);
mDrawerLayout.closeDrawer(mDrawerList);
} else {
// error in creating fragment
Log.e("Ramiro", "MainActivity - Error cuando se creo el fragment");
}
}
@Override
public void setTitle(CharSequence title) {
mTitle = title;
getActionBar().setTitle(mTitle);
}
/**
* When using the ActionBarDrawerToggle, you must call it during
* onPostCreate() and onConfigurationChanged()...
*/
@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 toggls
mDrawerToggle.onConfigurationChanged(newConfig);
In Response to Simon's question, here is my debug result:
http://imgur.com/eUbJwur,hNwymAF#0
And these are the variable results:
this = {com.wlodsgn.bunbunup.MenuActivity@831912707472}
adapter = {com.wlodsgn.bunbunup.NavDrawerListAdapter@831912476752}
mDrawerLayout = {android.support.v4.widget.DrawerLayout@831912722552}"android.support.v4.widget.DrawerLayout{b1dcc078 VFE..... ......I. 0,0-0,0 #7f090042 app:id/drawer_layout}"
mDrawerList = {android.widget.ListView@831912773352}"android.widget.ListView{b1dd86e8 VFED.VC. ......I. 0,0-0,0 #7f090044 app:id/list_slidermenu}"
mDrawerTitle = {java.lang.String@831912705496}"Menu"
mDrawerToggle = null
mTitle = {java.lang.String@831912705496}"Menu"
navDrawerItems = {java.util.ArrayList@831912670472} size = 2
navMenuIcons = {android.content.res.TypedArray@831912712688}"[3, 77, 2, 2130837561, 0, 160, 3, 73, 2, 2130837559, 0, 160, 3, 72, 2, 2130837560, 0, 160, 3, 76, 2, 2130837556, 0, 160, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, ...
navMenuTitles = {java.lang.String[4]@831912431488}
mActionBar = null
mActivityInfo = {android.content.pm.ActivityInfo@831912705176}"ActivityInfo{b1dc7c98 com.wlodsgn.bunbunup.MenuActivity}"
mAllLoaderManagers = null
mApplication = {android.app.Application@831912467056}
mWindowManager = {android.view.WindowManagerImpl@831912710184}
mWindow = {com.android.internal.policy.impl.PhoneWindow@831912708664}
mUiThread = {java.lang.Thread@831908953256}"Thread[main,5,main]"
mTranslucentCallback = null
mComponent = {android.content.ComponentName@831912704936}"ComponentInfo{com.wlodsgn.bunbunup/com.wlodsgn.bunbunup.MenuActivity}"
mToken = {android.os.BinderProxy@831912705080}
mContainer = {android.app.Activity$1@831912707880}
mCurrentConfig = {android.content.res.Configuration@831912708528}"{1.0 310mcc260mnc en_US ldltr sw360dp w360dp h567dp 480dpi nrml port finger qwerty/v/v -nav/h s.5}"
mDecor = null
mTitle = {java.lang.String@831912705496}"Menu"
mDefaultKeySsb = null
mSearchManager = null
mResultData = null
mEmbeddedID = null
mParent = null
mMenuInflater = null
mFragments = {android.app.FragmentManagerImpl@831912707760}"FragmentManager{b1dc86b0 in MenuActivity{b1dc8590}}"
mHandler = {android.os.Handler@831912708008}"Handler (android.os.Handler) {b1dc87a8}"
mManagedDialogs = null
mInstanceTracker = {android.os.StrictMode$InstanceTracker@831912707920}
mInstrumentation = {android.app.Instrumentation@831912463176}
mIntent = {android.content.Intent@831912704784}"Intent { cmp=com.wlodsgn.bunbunup/.MenuActivity }"
mLastNonConfigurationInstances = null
mLoaderManager = null
mManagedCursors = {java.util.ArrayList@831912707896} size = 0
mMainThread = {android.app.ActivityThread@831912436760}
mLoadersStarted = false
mIdent = -1308749784
mFinished = false
mEnableDefaultActionBarUp = false
mResultCode = 0
mDoReportFullyDrawn = true
mResumed = false
mDestroyed = false
mStartedActivity = false
mStopped = false
mTemporaryPause = false
mDefaultKeyMode = 0
mTitleColor = 0
mTitleReady = false
mConfigChangeFlags = 0
mCheckedForLoaderManager = false
mChangingConfigurations = false
mVisibleFromClient = true
mVisibleFromServer = false
mChangeCanvasToTranslucent = false
mWindowAdded = false
mCalled = true
mBase = {android.app.ContextImpl@831912708040}
mInflater = {com.android.internal.policy.impl.PhoneLayoutInflater@831912709768}
mOverrideConfiguration = null
mResources = {android.content.res.Resources@831912458488}
mTheme = {android.content.res.Resources$Theme@831912710208}
mThemeResource = 2131492864
mBase = {android.app.ContextImpl@831912708040}
savedInstanceState = null
mDrawerList = {android.widget.ListView@831912773352}"android.widget.ListView{b1dd86e8 VFED.VC. ......I. 0,0-0,0 #7f090044 app:id/list_slidermenu}"
mTempRect = {android.graphics.Rect@831912490576}"Rect(0, 0 - 0, 0)"
mArrowScrollFocusResult = {android.widget.ListView$ArrowScrollFocusResult@831912688680}
mDivider = {android.graphics.drawable.ColorDrawable@831912513672}
mOverScrollHeader = null
mOverScrollFooter = null
mDividerPaint = null
mFocusSelector = null
mHeaderViewInfos = {java.util.ArrayList@831912694584} size = 0
mFooterViewInfos = {java.util.ArrayList@831912689696} size = 0
mHeaderDividersEnabled = true
mFooterDividersEnabled = true
mIsCacheColorOpaque = false
mItemsCanFocus = false
mDividerIsOpaque = true
mDividerHeight = 3
mAreAllItemsSelectable = true
mAccessibilityDelegate = null
mVelocityTracker = null
mAdapter = {com.wlodsgn.bunbunup.NavDrawerListAdapter@831912476752}
mTouchModeReset = null
mTouchFrame = null
mTextFilter = null
mSelectorRect = {android.graphics.Rect@831912543968}"Rect(0, 0 - 0, 0)"
mCheckStates = {android.util.SparseBooleanArray@831912575600}"{}"
mCheckedIdStates = null
mSelector = {android.graphics.drawable.StateListDrawable@831912745608}
mChoiceActionMode = null
mScrollUp = null
mClearScrollingCache = null
mContextMenuInfo = null
mDataSetObserver = {android.widget.AbsListView$AdapterDataSetObserver@831912473520}
mDefInputConnection = null
mScrollStrictSpan = null
mScrollDown = null
mRemoteAdapter = null
mRecycler = {android.widget.AbsListView$RecycleBin@831912464376}
mEdgeGlowBottom = {android.widget.EdgeEffect@831912768272}
mEdgeGlowTop = {android.widget.EdgeEffect@831912774568}
mPublicInputConnection = null
mPositionScroller = null
mFastScroller = null
mPositionScrollAfterLayout = null
mPopup = null
mPerformClick = null
mFlingRunnable = null
mFlingStrictSpan = null
mPendingSync = null
mPendingCheckForTap = null
mPendingCheckForLongPress = null
mPendingCheckForKeyLongPress = null
mOwnerThread = {java.lang.Thread@831908953256}"Thread[main,5,main]"
mIsScrap = {boolean[1]@831912700520}
mOnScrollListener = null
mMultiChoiceModeCallback = null
mListPadding = {android.graphics.Rect@831912509624}"Rect(0, 0 - 0, 0)"
mLastPositionDistanceGuess = 0
mLastScrollState = 0
mLastTouchMode = -1
mLastY = 0
mLayoutMode = 0
mLastHandledItemCount = 0
mMaximumVelocity = 24000
mMinimumVelocity = 150
mMotionCorrection = 0
mMotionPosition = 0
mMotionViewNewTop = 0
mMotionViewOriginalTop = 0
mMotionX = 0
mMotionY = 0
mLastAccessibilityScrollEventToIndex = 0
mLastAccessibilityScrollEventFromIndex = 0
mOverflingDistance = 18
mOverscrollDistance = 0
mOverscrollMax = 0
mIsChildViewEnabled = false
mGlowPaddingRight = 0
mGlowPaddingLeft = 0
mGlobalLayoutListenerAddedFilter = false
mForceTranscriptScroll = false
mFlingProfilingStarted = false
mFirstPositionDistanceGuess = 0
mPopupHidden = false
mFiltered = false
mFastScrollEnabled = false
mFastScrollAlwaysVisible = false
mDrawSelectorOnTop = false
mDirection = 0
mResurrectToPosition = -1
mDensityScale = 3.0
mScrollProfilingStarted = false
mDeferNotifyDataSetChanged = false
mChoiceMode = 1
mScrollingCacheEnabled = true
mSelectedTop = 0
mSelectionBottomPadding = 0
mSelectionLeftPadding = 0
mSelectionRightPadding = 0
mSelectionTopPadding = 0
mCheckedItemCount = 0
mSelectorPosition = -1
mCachingStarted = false
mSmoothScrollbarEnabled = true
mStackFromBottom = false
mCachingActive = false
mTextFilterEnabled = false
mCacheColorHint = 0
mTouchMode = -1
mAdapterHasStableIds = false
mTouchSlop = 24
mTranscriptMode = 0
mVelocityScale = 1.0
mActivePointerId = -1
mWidthMeasureSpec = 0
mSelectionNotifier = null
mOnItemSelectedListener = null
mOnItemLongClickListener = null
mOnItemClickListener = {com.wlodsgn.bunbunup.MenuActivity$SlideMenuClickListener@831912422512}
mEmptyView = null
mSyncRowId = -9223372036854775808
mSyncHeight = 0
mSelectedRowId = -9223372036854775808
mOldSelectedRowId = -9223372036854775808
mNextSelectedRowId = -9223372036854775808
mNextSelectedPosition = -1
mNeedSync = false
mOldItemCount = 0
mOldSelectedPosition = -1
mLayoutHeight = 0
mDesiredFocusableState = true
mDesiredFocusableInTouchModeState = true
mDataChanged = false
mSelectedPosition = -1
mItemCount = 2
mBlockLayoutRequests = false
mSpecificTop = 0
mInLayout = false
mSyncMode = 0
mSyncPosition = 0
mFirstPosition = 0
mAnimationListener = null
mCachePaint = null
mVisibilityChangingChildren = null
mTransitioningViews = null
mChildTransformation = null
mChildren = {android.view.View[12]@831912500288}
mTransition = null
mCurrentDrag = null
mCurrentDragView = null
mDisappearingChildren = null
mDragNotifiedChildren = null
mFirstHoverTarget = null
mFirstTouchTarget = null
mFocused = null
mOnHierarchyChangeListener = null
mLocalPoint = null
mInvalidateRegion = null
mInvalidationTransformation = null
mLayoutTransitionListener = {android.view.ViewGroup$3@831912441104}
mLayoutAnimationController = null
mLastTouchDownX = 0.0
mLastTouchDownTime = 0
mLastTouchDownY = 0.0
mLayoutCalledWhileSuppressed = false
mLayoutMode = -1
mLastTouchDownIndex = -1
mHoveredSelf = false
mGroupFlags = 2228307
mPersistentDrawingCache = 2
mSuppressLayout = false
mChildrenCount = 0
mChildCountWithTransientState = 0
mChildAcceptsDrag = false
mUnsetPressedState = null
mAccessibilityDelegate = null
mUnscaledDrawingCache = null
mAnimator = null
mAttachInfo = null
mBackground = {android.graphics.drawable.ColorDrawable@831912688536}
mTransformationInfo = null
mTouchDelegate = null
mTag = null
mSendViewStateChangedAccessibilityEvent = null
mClipBounds = null
mContentDescription = null
mContext = {com.wlodsgn.bunbunup.MenuActivity@831912707472}
mCurrentAnimation = null
mDisplayList = null
mDrawableState = null
mDrawingCache = null
mSendViewScrolledAccessibilityEvent = null
mFloatingTreeObserver = null
mHardwareLayer = null
mScrollCache = {android.view.View$ScrollabilityCache@831912606240}
mResources = {android.content.res.Resources@831912458488}
mInputEventConsistencyVerifier = {android.view.InputEventConsistencyVerifier@831912774440}
mKeyedTags = null
mPerformClick = null
mPendingCheckForTap = null
mLayerPaint = null
mPendingCheckForLongPress = null
mLayoutInsets = null
mLayoutParams = {android.support.v4.widget.DrawerLayout$LayoutParams@831912431416}
mParent = {android.support.v4.widget.DrawerLayout@831912722552}"android.support.v4.widget.DrawerLayout{b1dcc078 VFE..... ......I. 0,0-0,0 #7f090042 app:id/drawer_layout}"
mOverlay = null
mListenerInfo = null
mLocalDirtyRect = null
mMatchIdPredicate = null
mMatchLabelForPredicate = null
mMeasureCache = null
mMeasuredHeight = 0
mMeasuredWidth = 0
mMinHeight = 0
mMinWidth = 0
mNextFocusDownId = -1
mNextFocusForwardId = -1
mNextFocusLeftId = -1
mNextFocusRightId = -1
mNextFocusUpId = -1
mOldHeightMeasureSpec = -2147483648
mOldWidthMeasureSpec = -2147483648
mOverScrollMode = 1
mLeftPaddingDefined = false
mPaddingBottom = 0
mPaddingLeft = 0
mPaddingRight = 0
mPaddingTop = 0
mLeft = 0
mLayerType = 0
mLastIsOpaque = false
mLabelForId = -1
mPrivateFlags = -2121789184
mPrivateFlags2 = 4334600
mPrivateFlags3 = 0
mRecreateDisplayList = false
mID = 2131296324
mRight = 0
mRightPaddingDefined = false
mHasPerformedLongPress = false
mScrollX = 0
mScrollY = 0
mDrawingCacheBackgroundColor = 0
mCachingFailed = false
mSendingHoverAccessibilityEvents = false
mSystemUiVisibility = 0
mBottom = 0
mTop = 0
mBackgroundSizeChanged = true
mTouchSlop = 24
mBackgroundResource = 0
mTransientStateCount = 0
mAccessibilityViewId = -1
mAccessibilityCursorPosition = -1
mUserPaddingBottom = 0
mUserPaddingEnd = -2147483648
mUserPaddingLeft = 0
mUserPaddingLeftInitial = 0
mUserPaddingRight = 0
mUserPaddingRightInitial = 0
mUserPaddingStart = -2147483648
mVerticalScrollFactor = 0.0
mVerticalScrollbarPosition = 0
mViewFlags = 402932225
mWindowAttachCount = 0
adapter = {com.wlodsgn.bunbunup.NavDrawerListAdapter@831912476752}
context = {android.app.Application@831912467056}
navDrawerItems = {java.util.ArrayList@831912670472} size = 2
mDataSetObservable = {android.database.DataSetObservable@831912431560}
mDrawerToggle = null
Now, when I do the step over, these are the results:
http://imgur.com/eUbJwur,hNwymAF#1
Debug with variable after doing STEPOVER results posted in the comment section since they don't let me add more than 2 links.
If you need info from the subvariables in the debug, let me know
As for goonerandroid's request, here is my styles.xml code:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
try changing your theme to this
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
and not the AppCompat Version.It basically depends on whch api you are targeting.If it less than 14 use
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
and in your activity call your actionbar using this
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
这篇关于Android的工作室1.0.2:了java.lang.RuntimeException:无法启动活动ComponentInfo:显示java.lang.NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!