Autore Topic: Problema Navigation Drawer  (Letto 403 volte)

Offline felasandroid

  • Utente normale
  • ***
  • Post: 345
  • Respect: +10
    • Github
    • balduzziantonio
    • balduzziantonio.unifi
    • Mostra profilo
  • Dispositivo Android:
    Huawei P8 Lite
  • Play Store ID:
    FelasTech
  • Sistema operativo:
    Windows 10
Problema Navigation Drawer
« il: 14 Gennaio 2014, 15:28:57 CET »
0
Ho seguito il tutorial, io ho un'activity che estende un FragmentActivity e implementa ActionBar.TabListener.

Ho seguito i passi del tutorial ma si vede sbaglio in qualcosa, ad esempio io ora avrei questo codice:

Codice (Java): [Seleziona]
        ab = getActionBar();
                ab.setHomeButtonEnabled(false);
                ab.setDisplayHomeAsUpEnabled(true);
                ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

getActionBar().setDisplayHomeAsUpEnabled(true);
                getActionBar().setHomeButtonEnabled(true);
               
               
               
               
                for (String tab_name : tabs) {
                        ab.addTab(ab.newTab().setText(tab_name)
                    .setTabListener(this));
        }
                mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
                mDrawer.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);

                _initMenu();

                mDrawerToggle = new CustomActionBarDrawerToggle(this, mDrawer);
                mDrawer.setDrawerListener(mDrawerToggle);

ma ho il seguente errore nel LogCat:

Codice: [Seleziona]
01-14 15:26:03.671: E/AndroidRuntime(5806): FATAL EXCEPTION: main
01-14 15:26:03.671: E/AndroidRuntime(5806): android.content.res.Resources$NotFoundException: String resource ID #0x0
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.content.res.Resources.getText(Resources.java:242)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.widget.TextView.setText(TextView.java:3783)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at felastech.websourcerequest.NsMenuAdapter.getView(NsMenuAdapter.java:94)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.widget.AbsListView.obtainView(AbsListView.java:2461)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.widget.ListView.makeAndAddView(ListView.java:1775)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.widget.ListView.fillDown(ListView.java:678)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.widget.ListView.fillFromTop(ListView.java:739)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.widget.ListView.layoutChildren(ListView.java:1628)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.widget.AbsListView.onLayout(AbsListView.java:2296)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.View.layout(View.java:14055)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.ViewGroup.layout(ViewGroup.java:4604)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:702)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.View.layout(View.java:14055)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.ViewGroup.layout(ViewGroup.java:4604)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.View.layout(View.java:14055)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.ViewGroup.layout(ViewGroup.java:4604)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1655)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1513)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.widget.LinearLayout.onLayout(LinearLayout.java:1426)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.View.layout(View.java:14055)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.ViewGroup.layout(ViewGroup.java:4604)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.View.layout(View.java:14055)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.ViewGroup.layout(ViewGroup.java:4604)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1992)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1813)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1112)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4472)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.Choreographer.doCallbacks(Choreographer.java:555)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.Choreographer.doFrame(Choreographer.java:525)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.os.Handler.handleCallback(Handler.java:615)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.os.Handler.dispatchMessage(Handler.java:92)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.os.Looper.loop(Looper.java:137)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at android.app.ActivityThread.main(ActivityThread.java:4898)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at java.lang.reflect.Method.invokeNative(Native Method)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at java.lang.reflect.Method.invoke(Method.java:511)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
01-14 15:26:03.671: E/AndroidRuntime(5806):         at dalvik.system.NativeStart.main(Native Method)

Post unito: 14 Gennaio 2014, 17:15:17 CET
ora ho provato a creare un'altra activity solo col codice dell'esempio ma nulla..sempre il solito errore..
« Ultima modifica: 14 Gennaio 2014, 17:15:17 CET da felasandroid, Reason: Merged DoublePost »