Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Tela de lista das provas não abre (ProvasActivity / provas_lista.xml)

Quando clico na opção Baixar Provas a tela não abre e nem se quer aparece uma mensagem de erro na tela do emulador ou no LogCat.

Método da classe ListaAlunosActivity que tem o menu pra chegar na tela Baixar Provas (lista de provas):

@Override
        public boolean onOptionsItemSelected(MenuItem item) {
            int itemClicado = item.getItemId();

            switch (itemClicado) {
            case R.id.menu_novo:
                Intent irParaFormulario = new Intent(this, FormularioActivity.class);
                startActivity(irParaFormulario);
                break;

            case R.id.receber_provas:
                Intent irParaProvas = new Intent(this, ProvasActivity.class);
                startActivity(irParaProvas);
                break;

                case R.id.menu_enviar_alunos:
                    EnviaAlunosTask task = new EnviaAlunosTask(this);
                    task.execute();

            default:
                break;
            }
            return false;

        }

Classe ProvasActivity

public class ProvasActivity extends FragmentActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.provas);

        FragmentManager manager = getSupportFragmentManager();

        FragmentTransaction transaction = manager.beginTransaction();

        if (isTabletEmLandscape()) {
            transaction.replace(R.id.esquerda, new ListaProvasFragment());
            transaction.replace(R.id.direita, new DetalhesProvaFragment());
        } else {
            transaction.replace(R.id.unico, new ListaProvasFragment());
        }

        transaction.commit();

    }

    private boolean isTabletEmLandscape() {
        return getResources().getBoolean(R.bool.ehTabletNaHorizontal);
    }

}

Classe ListaProvasFragment

public class ListaProvasFragment extends Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater,
            @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View listaDeProvas = inflater.inflate(R.layout.provas_lista, null);
        ListView listagemProvas = (ListView) listaDeProvas.findViewById(R.id.provas);

        Prova prova1 = new Prova("20/03/2014", "Matematica");
        prova1.setTopicos(Arrays.asList("Algebra linera", "Integral",
                "Diferencial"));

        Prova prova2 = new Prova("20/10/2014", "Portugues");
        prova2.setTopicos(Arrays.asList("Complemento nominal",
                "Oracoes subordinadas"));

        List<Prova> provas = Arrays.asList(prova1, prova2);

        int layout = android.R.layout.simple_list_item_1;

        FragmentActivity context = getActivity();

        ArrayAdapter<Prova> adapter = new ArrayAdapter<Prova>(context, layout,
                provas);

        listagemProvas.setAdapter(adapter);
        return listaDeProvas;
    }

AndroidManifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="br.com.example.cadastro"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="21" />

    <uses-permission android:name="android.permission.CALL_PHONE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.RECEIVE_SMS"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <activity
            android:name="br.com.caelum.cadastro.ListaAlunosActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="br.com.caelum.cadastro.FormularioActivity" 
             android:label="@string/app_name">

        </activity>

        <activity android:name="br.com.caelum.cadastro.ProvasActivity" 
             android:label="@string/app_name">

        </activity>

        <receiver android:name="br.com.caelum.cadastro.SMSReceiver" android:enabled="true">
            <intent-filter >
                <action android:name="android.provider.Telephony.SMS_RECEIVED"/>
            </intent-filter>

        </receiver>

    </application>

</manifest>

LogCat:

12-09 19:16:43.048: D/AndroidRuntime(1496): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
12-09 19:16:43.071: D/AndroidRuntime(1496): CheckJNI is ON
12-09 19:16:43.528: E/memtrack(1496): Couldn't load memtrack module (No such file or directory)
12-09 19:16:43.528: E/android.os.Debug(1496): failed to load memtrack module: -2
12-09 19:16:43.760: D/AndroidRuntime(1496): Calling main entry com.android.commands.pm.Pm
12-09 19:16:43.931: D/DefContainer(849): Copying /data/local/tmp/CadastroCaelum.apk to base.apk
12-09 19:16:45.250: D/PackageManager(352): Renaming /data/app/vmdl1706780156.tmp to /data/app/br.com.example.cadastro-1
12-09 19:16:45.296: I/ActivityManager(352): Force stopping br.com.example.cadastro appid=10046 user=-1: uninstall pkg
12-09 19:16:45.299: I/ActivityManager(352): Killing 1467:br.com.example.cadastro/u0a46 (adj 0): stop br.com.example.cadastro
12-09 19:16:45.359: W/InputDispatcher(352): channel '10a42770 br.com.example.cadastro/br.com.caelum.cadastro.ListaAlunosActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
12-09 19:16:45.359: E/InputDispatcher(352): channel '10a42770 br.com.example.cadastro/br.com.caelum.cadastro.ListaAlunosActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
12-09 19:16:45.365: W/InputDispatcher(352): channel '3c4ec21b PopupWindow:28e14237 (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
12-09 19:16:45.365: E/InputDispatcher(352): channel '3c4ec21b PopupWindow:28e14237 (server)' ~ Channel is unrecoverably broken and will be disposed!
12-09 19:16:45.370: I/WindowState(352): WIN DEATH: Window{3c4ec21b u0 PopupWindow:28e14237}
12-09 19:16:45.370: W/InputDispatcher(352): Attempted to unregister already unregistered input channel '3c4ec21b PopupWindow:28e14237 (server)'
12-09 19:16:45.397: W/ActivityManager(352): Force removing ActivityRecord{13e8ae40 u0 br.com.example.cadastro/br.com.caelum.cadastro.ListaAlunosActivity t33}: app died, no saved state
12-09 19:16:45.463: I/WindowState(352): WIN DEATH: Window{10a42770 u0 br.com.example.cadastro/br.com.caelum.cadastro.ListaAlunosActivity}
12-09 19:16:45.463: W/InputDispatcher(352): Attempted to unregister already unregistered input channel '10a42770 br.com.example.cadastro/br.com.caelum.cadastro.ListaAlunosActivity (server)'
12-09 19:16:45.465: W/WindowManager(352): Force-removing child win Window{3c4ec21b u0 PopupWindow:28e14237 EXITING} from container Window{10a42770 u0 br.com.example.cadastro/br.com.caelum.cadastro.ListaAlunosActivity}
12-09 19:16:45.888: I/PackageManager(352): Package br.com.example.cadastro codePath changed from /data/app/br.com.example.cadastro-2 to /data/app/br.com.example.cadastro-1; Retaining data and using new
12-09 19:16:45.953: W/ActivityManager(352): Spurious death for ProcessRecord{1d4f70ce 1467:br.com.example.cadastro/u0a46}, curProc for 1467: null
12-09 19:16:46.268: W/InputMethodManagerService(352): Got RemoteException sending setActive(false) notification to pid 1467 uid 10046
12-09 19:16:46.914: I/art(352): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/data@app@br.com.example.cadastro-1@base.apk@classes.dex' for file location '/data/app/br.com.example.cadastro-1/base.apk': Failed to open oat filename for reading: No such file or directory
12-09 19:16:46.915: I/art(352): DexFile_isDexOptNeeded failed to open oat file '/data/app/br.com.example.cadastro-1/arm/base.odex' for file location '/data/app/br.com.example.cadastro-1/base.apk': Failed to open oat filename for reading: No such file or directory
12-09 19:16:46.915: I/PackageManager(352): Running dexopt on: /data/app/br.com.example.cadastro-1/base.apk pkg=br.com.example.cadastro isa=arm vmSafeMode=false
12-09 19:16:47.458: I/dex2oat(1508): /system/bin/dex2oat --zip-fd=6 --zip-location=/data/app/br.com.example.cadastro-1/base.apk --oat-fd=7 --oat-location=/data/dalvik-cache/arm/data@app@br.com.example.cadastro-1@base.apk@classes.dex --instruction-set=arm --instruction-set-features=default --runtime-arg -Xms64m --runtime-arg -Xmx512m
12-09 19:16:48.641: W/dex2oat(1508): Before Android 4.1, method int android.support.v7.internal.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
12-09 19:17:00.296: W/dex2oat(1508): Compilation of void android.support.v7.internal.app.WindowDecorActionBar.setIcon(int) took 282.606ms
12-09 19:17:02.655: I/dex2oat(1508): dex2oat took 15.195s (threads: 1)
12-09 19:17:02.678: I/ActivityManager(352): Force stopping br.com.example.cadastro appid=10046 user=-1: update pkg
12-09 19:17:02.681: W/PackageManager(352): Code path for pkg : br.com.example.cadastro changing from /data/app/br.com.example.cadastro-2 to /data/app/br.com.example.cadastro-1
12-09 19:17:02.685: W/PackageManager(352): Resource path for pkg : br.com.example.cadastro changing from /data/app/br.com.example.cadastro-2 to /data/app/br.com.example.cadastro-1
12-09 19:17:02.914: I/ActivityManager(352): Force stopping br.com.example.cadastro appid=10046 user=0: pkg removed
12-09 19:17:02.984: I/InputReader(352): Reconfiguring input devices.  changes=0x00000010
12-09 19:17:03.024: D/BackupManagerService(352): Received broadcast Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:br.com.example.cadastro flg=0x4000010 (has extras) }
12-09 19:17:03.026: D/JobSchedulerService(352): Receieved: android.intent.action.PACKAGE_REMOVED
12-09 19:17:03.173: I/InputReader(352): Reconfiguring input devices.  changes=0x00000010
12-09 19:17:03.189: I/InputReader(352): Reconfiguring input devices.  changes=0x00000010
12-09 19:17:03.193: W/Settings(352): Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure, returning read-only value.
12-09 19:17:03.244: D/BackupManagerService(352): Received broadcast Intent { act=android.intent.action.PACKAGE_ADDED dat=package:br.com.example.cadastro flg=0x4000010 (has extras) }
12-09 19:17:03.248: W/BackupManagerService(352): Removing schedule queue dupe of br.com.example.cadastro
12-09 19:17:03.277: W/ContextImpl(817): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1686 android.content.ContextWrapper.startService:515 android.content.ContextWrapper.startService:515 com.android.keychain.KeyChainBroadcastReceiver.onReceive:12 android.app.ActivityThread.handleReceiver:2579 
12-09 19:17:03.308: I/ActivityManager(352): Delay finish: com.android.keychain/.KeyChainBroadcastReceiver
12-09 19:17:03.439: I/ActivityManager(352): Resuming delayed broadcast
12-09 19:17:03.998: W/VoiceInteractionManagerService(352): no available voice recognition services found for user 0
12-09 19:17:04.414: I/art(352): Explicit concurrent mark sweep GC freed 27575(1593KB) AllocSpace objects, 8(163KB) LOS objects, 19% free, 6MB/8MB, paused 2.637ms total 1.215s
12-09 19:17:04.418: I/art(352): WaitForGcToComplete blocked for 1.181s for cause Background
12-09 19:17:04.490: D/AndroidRuntime(1496): Shutting down VM
12-09 19:17:04.515: I/art(1496): Debugger is no longer active
12-09 19:17:05.945: D/AndroidRuntime(1514): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
12-09 19:17:05.968: D/AndroidRuntime(1514): CheckJNI is ON
12-09 19:17:06.486: E/memtrack(1514): Couldn't load memtrack module (No such file or directory)
12-09 19:17:06.486: E/android.os.Debug(1514): failed to load memtrack module: -2
12-09 19:17:06.747: D/AndroidRuntime(1514): Calling main entry com.android.commands.am.Am
12-09 19:17:06.799: I/ActivityManager(352): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=br.com.example.cadastro/br.com.caelum.cadastro.ListaAlunosActivity} from uid 0 on display 0
12-09 19:17:06.868: D/AndroidRuntime(1514): Shutting down VM
12-09 19:17:06.871: I/art(1514): Debugger is no longer active
12-09 19:17:07.104: I/ActivityManager(352): Start proc br.com.example.cadastro for activity br.com.example.cadastro/br.com.caelum.cadastro.ListaAlunosActivity: pid=1525 uid=10046 gids={50046, 9997, 3003, 1028} abi=armeabi-v7a
12-09 19:17:07.238: I/art(1525): Not late-enabling -Xcheck:jni (already on)
12-09 19:17:08.293: I/Choreographer(352): Skipped 36 frames!  The application may be doing too much work on its main thread.
12-09 19:17:09.544: I/Choreographer(1525): Skipped 106 frames!  The application may be doing too much work on its main thread.
12-09 19:17:09.569: D/gralloc_goldfish(1525): Emulator without GPU emulation detected.
12-09 19:17:09.664: I/ActivityManager(352): Displayed br.com.example.cadastro/br.com.caelum.cadastro.ListaAlunosActivity: +2s769ms
12-09 19:17:10.214: I/Choreographer(1525): Skipped 40 frames!  The application may be doing too much work on its main thread.
12-09 19:17:10.353: D/TaskPersister(352): removeObsoleteFile: deleting file=33_task.xml
12-09 19:17:28.141: W/AudioTrack(352): AUDIO_OUTPUT_FLAG_FAST denied by client
12-09 19:17:28.371: W/art(1525): Before Android 4.1, method int android.support.v7.internal.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
12-09 19:17:28.491: I/Choreographer(1525): Skipped 92 frames!  The application may be doing too much work on its main thread.
12-09 19:17:28.695: I/Choreographer(1525): Skipped 52 frames!  The application may be doing too much work on its main thread.
12-09 19:17:28.914: I/Choreographer(1525): Skipped 48 frames!  The application may be doing too much work on its main thread.
12-09 19:17:29.179: I/Choreographer(1525): Skipped 66 frames!  The application may be doing too much work on its main thread.
12-09 19:17:30.490: W/AudioTrack(352): AUDIO_OUTPUT_FLAG_FAST denied by client
12-09 19:17:30.959: I/art(1525): Background sticky concurrent mark sweep GC freed 1815(153KB) AllocSpace objects, 0(0B) LOS objects, 9% free, 2MB/2MB, paused 3.397ms total 174.315ms
12-09 19:17:30.989: I/Choreographer(1525): Skipped 140 frames!  The application may be doing too much work on its main thread.
12-09 19:17:31.208: W/InputMethodManagerService(352): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@1b00cbb6 attribute=null, token = android.os.BinderProxy@7506d1d
12-09 19:17:31.214: I/Choreographer(1525): Skipped 57 frames!  The application may be doing too much work on its main thread.
12-09 19:17:31.363: I/Choreographer(1525): Skipped 37 frames!  The application may be doing too much work on its main thread.
12-09 19:17:32.729: W/AudioTrack(352): AUDIO_OUTPUT_FLAG_FAST denied by client
12-09 19:17:32.882: I/Choreographer(1525): Skipped 45 frames!  The application may be doing too much work on its main thread.
12-09 19:17:33.093: W/InputMethodManagerService(352): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@22c60b7 attribute=null, token = android.os.BinderProxy@7506d1d
12-09 19:17:33.103: I/Choreographer(1525): Skipped 55 frames!  The application may be doing too much work on its main thread.

Quem souber o que esta acontecendo me fala ai.

1 resposta
solução!

Poste, por favor, o onCreateOptionsMenu da sua classe ListaAlunosActivity e o seu menu_principal.xml.