2015-02-14 6 views
1

Здесь ошибка:Android 1.0.2 Студия: java.lang.RuntimeException: Невозможно начать деятельность ComponentInfo: java.lang.NullPointerException

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 

я серьезно понятия не имею, что может быть проблема, отработавшие пару часов, пытаясь найти решение, но оно все еще терпит крах. Идея состоит в том, чтобы сделать мою первую основную деятельность (IntroActivity.java) открыть другое действие (menuactivity.java) с помощью навигационного ящика. Любая помощь будет принята с благодарностью.

Вот 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"); 
    } 
} 

Вот 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); 

В ответ на вопрос Саймона, вот мой результат отладки:

http://imgur.com/eUbJwur,hNwymAF#0

и эти переменные результаты:

this = {[email protected]} 
adapter = {[email protected]} 
mDrawerLayout = {[email protected]}"android.support.v4.widget.DrawerLayout{b1dcc078 VFE..... ......I. 0,0-0,0 #7f090042 app:id/drawer_layout}" 
mDrawerList = {[email protected]}"android.widget.ListView{b1dd86e8 VFED.VC. ......I. 0,0-0,0 #7f090044 app:id/list_slidermenu}" 
mDrawerTitle = {[email protected]}"Menu" 
mDrawerToggle = null 
mTitle = {[email protected]}"Menu" 
navDrawerItems = {[email protected]} size = 2 
navMenuIcons = {[email protected]}"[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 = {[email protected]}"ActivityInfo{b1dc7c98 com.wlodsgn.bunbunup.MenuActivity}" 
mAllLoaderManagers = null 
mApplication = {[email protected]} 
mWindowManager = {[email protected]} 
mWindow = {[email protected]} 
mUiThread = {[email protected]}"Thread[main,5,main]" 
mTranslucentCallback = null 
mComponent = {[email protected]}"ComponentInfo{com.wlodsgn.bunbunup/com.wlodsgn.bunbunup.MenuActivity}" 
mToken = {[email protected]} 
mContainer = {[email protected]} 
mCurrentConfig = {[email protected]}"{1.0 310mcc260mnc en_US ldltr sw360dp w360dp h567dp 480dpi nrml port finger qwerty/v/v -nav/h s.5}" 
mDecor = null 
mTitle = {[email protected]}"Menu" 
mDefaultKeySsb = null 
mSearchManager = null 
mResultData = null 
mEmbeddedID = null 
mParent = null 
mMenuInflater = null 
mFragments = {[email protected]}"FragmentManager{b1dc86b0 in MenuActivity{b1dc8590}}" 
mHandler = {[email protected]}"Handler (android.os.Handler) {b1dc87a8}" 
mManagedDialogs = null 
mInstanceTracker = {[email protected]} 
mInstrumentation = {[email protected]} 
mIntent = {[email protected]}"Intent { cmp=com.wlodsgn.bunbunup/.MenuActivity }" 
mLastNonConfigurationInstances = null 
mLoaderManager = null 
mManagedCursors = {[email protected]} size = 0 
mMainThread = {[email protected]} 
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 = {[email protected]} 
mInflater = {[email protected]8} 
mOverrideConfiguration = null 
mResources = {[email protected]} 
mTheme = {[email protected]} 
mThemeResource = 2131492864 
mBase = {[email protected]} 
savedInstanceState = null 
mDrawerList = {[email protected]}"android.widget.ListView{b1dd86e8 VFED.VC. ......I. 0,0-0,0 #7f090044 app:id/list_slidermenu}" 
mTempRect = {[email protected]}"Rect(0, 0 - 0, 0)" 
mArrowScrollFocusResult = {[email protected]0} 
mDivider = {[email protected]} 
mOverScrollHeader = null 
mOverScrollFooter = null 
mDividerPaint = null 
mFocusSelector = null 
mHeaderViewInfos = {[email protected]} size = 0 
mFooterViewInfos = {[email protected]} size = 0 
mHeaderDividersEnabled = true 
mFooterDividersEnabled = true 
mIsCacheColorOpaque = false 
mItemsCanFocus = false 
mDividerIsOpaque = true 
mDividerHeight = 3 
mAreAllItemsSelectable = true 
mAccessibilityDelegate = null 
mVelocityTracker = null 
mAdapter = {[email protected]} 
mTouchModeReset = null 
mTouchFrame = null 
mTextFilter = null 
mSelectorRect = {[email protected]}"Rect(0, 0 - 0, 0)" 
mCheckStates = {[email protected]}"{}" 
mCheckedIdStates = null 
mSelector = {[email protected]} 
mChoiceActionMode = null 
mScrollUp = null 
mClearScrollingCache = null 
mContextMenuInfo = null 
mDataSetObserver = {[email protected]} 
mDefInputConnection = null 
mScrollStrictSpan = null 
mScrollDown = null 
mRemoteAdapter = null 
mRecycler = {[email protected]} 
mEdgeGlowBottom = {[email protected]} 
mEdgeGlowTop = {[email protected]} 
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 = {[email protected]}"Thread[main,5,main]" 
mIsScrap = {boolean[1]@831912700520} 
mOnScrollListener = null 
mMultiChoiceModeCallback = null 
mListPadding = {[email protected]}"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 = {[email protected]22512} 
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 = {[email protected]} 
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 = {[email protected]} 
mTransformationInfo = null 
mTouchDelegate = null 
mTag = null 
mSendViewStateChangedAccessibilityEvent = null 
mClipBounds = null 
mContentDescription = null 
mContext = {[email protected]} 
mCurrentAnimation = null 
mDisplayList = null 
mDrawableState = null 
mDrawingCache = null 
mSendViewScrolledAccessibilityEvent = null 
mFloatingTreeObserver = null 
mHardwareLayer = null 
mScrollCache = {[email protected]} 
mResources = {[email protected]} 
mInputEventConsistencyVerifier = {[email protected]} 
mKeyedTags = null 
mPerformClick = null 
mPendingCheckForTap = null 
mLayerPaint = null 
mPendingCheckForLongPress = null 
mLayoutInsets = null 
mLayoutParams = {[email protected]} 
mParent = {[email protected]}"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 = {[email protected]} 
context = {[email protected]} 
navDrawerItems = {[email protected]} size = 2 
mDataSetObservable = {[email protected]} 
mDrawerToggle = null 

Теперь, когда я делаю шаг через эти результаты:

http://imgur.com/eUbJwur,hNwymAF#1

Debug с переменной после выполнения результатов StepOver размещенные в разделе комментариев, так как они не позволяют мне добавить более двух ссылок.

Если вам нужна информация от subvariables в отлаживать, дайте мне знать

Как для запроса goonerandroid, вот мой styles.xml код:

<resources> 

    <!-- Base application theme. --> 
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
     <!-- Customize your theme here. --> 
    </style> 

</resources> 
+0

Wich линия является линией 81 в вашем «MenuActivity»? – Jens

+0

Это прямо в трассировке стека 'Caused by: java.lang.NullPointerException at com.wlodsgn.bunbunup.MenuActivity.onCreate (MenuActivity.java:81)' что такое строка 81? – Simon

+0

Спасибо за быстрый ответ Йенс и Саймон, строка 81: getActionBar(). SetDisplayHomeAsUpEnabled (true); –

ответ

1

попробовать сменить вашу тему на это

<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar"> 

и не AppCompat Version.It в основном зависит от whch апи вы targeting.If это меньше, чем 14 использование

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 

и в своей деятельности называют ваш ActionBar с помощью этого

getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
+0

Спасибо за помощь gooner! Он фактически работал, не меняя getActionBar на getSupportActionBar. Нужно ли менять его? Я имею в виду, когда я это делаю, отображается ошибка, говорящая, что он не может разрешить метод. Нужно ли мне импортировать «android.support.v7.app.ActionBarActivity», чтобы он мог работать? И я предполагаю, что я должен изменить другой getActionBar ниже этого с момента появления ошибки. (Проверьте мой MenuActivity.java в моем OP) –

Смежные вопросы