• Matéria: Informática
  • Autor: marciomeigo
  • Perguntado 7 anos atrás

Segundo a documentação do Google Android, todas as Activities de um aplicativo Android devem ser declaradas no arquivo AndroidManifest.xml. No entanto, a principal Activity do aplicativo deve fornecer algumas informações adicionais.

Considerando o contexto apresentado, assinale a alternativa que declara CORRETAMENTE, no arquivo AndroidManifest.xml, a classe MainActivity como sendo a principal Activity do aplicativo.

Escolha uma:
A)
<?xml version="1.0" encoding="utf-8"?>
<manifest>
  ...
  <application>
    ...
    <activity android:name=".MainActivity">
      <intent-filter>
        <action android:name="android.intent.action.LAUNCHER" />
      </intent-filter>
    </activity>
  </application>
</manifest>

B)
. <?xml version="1.0" encoding="utf-8"?>
<manifest>
  ...
  <application>
    ...
    <activity android:name=".MainActivity">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
  </application>
</manifest>

C)
. <?xml version="1.0" encoding="utf-8"?>
<manifest>
  ...
  <application>
    ...
    <activity android:name=".MainActivity">
      <intent-filter>
      <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
  </application>
</manifest>

D)
. <?xml version="1.0" encoding="utf-8"?>
<manifest>
  ...
  <application>
    ...
    <activity android:name=".MainActivity">
      <intent-filter>
        <category android:name="android.intent.category.MAIN" />
      </intent-filter>
    </activity>
  </application>
</manifest>

E)
.<?xml version="1.0" encoding="utf-8"?>
<manifest>
  ...
  <application>
    ...
    <activity android:name=".MainActivity">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
      </intent-filter>
    </activity>
  </application>
</manifest>

Respostas

respondido por: amandarc23
3

Resposta:

Alternativa b

Explicação:

b)

<?xml version="1.0" encoding="utf-8"?>

<manifest>

 ...

 <application>

   ...

   <activity android:name=" . MainActivity">

     <intent-filter>

       <action android:name="android. intent .action .MAIN" />

       <category android:name="android. intent. category. LAUNCHER" />

     </intent-filter>

   </activity>

 </application>

</manifest>

Perguntas similares