He tells me that I should add the fragment to Manifest but he will not let me ...
This is the error in the logcat
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.matias.finalcode, PID: 9941
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.matias.finalcode/com.example.matias.finalcode.Fragments.InicioFragment}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1761)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1485)
at android.app.Activity.startActivityForResult(Activity.java:3782)
at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:67)
at android.app.Activity.startActivityForResult(Activity.java:3743)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:732)
at android.app.Activity.startActivity(Activity.java:4053)
at android.app.Activity.startActivity(Activity.java:4021)
at com.example.matias.finalcode.Bancos.Banco1$2.onClick(Banco1.java:99)
at android.view.View.performClick(View.java:4757)
at android.view.View$PerformClick.run(View.java:19757)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5258)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
I/Process: Sending signal. PID: 9941 SIG: 9
Application terminated.
And this is the button in the Activity that should take me to the fragment
btnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Banco1.this, InicioFragment.class);
startActivity(intent);
finish();
}
});
This is my MANIFEST
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.matias.finalcode.InicioActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar" />
<activity android:name=".SignupActivity" />
<activity android:name=".ResetPasswordActivity" />
<activity android:name=".Bancos.Banco1">
</activity>
</application>