0
Hello, everybody.
I’m trying to build an app inspired by pokedex for a challenge, and trying to use the MVC architecture.
I’m having problems accessing the activities (that are inside the packages I created) through the manifest file.
Below is manifest code and activities.
Could someone tell me what is wrong on the way to Activity?
Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.pokemon">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_splash_screen_pokemon_round"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity android:name="com.pokemon.View.SplashScreenActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.pokemon.View.MainActivity"/>
</application>
</manifest>
Mainactivity.java
package com.pokemon.View;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.pokemon.R;
public class MainActivity extends AppCompatActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Splashscreenactivity.java
package com.pokemon.View;
import android.content.Intent;
import android.os.Handler;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.pokemon.R;
public class SplashScreenActivity extends AppCompatActivity
{
/* Timer Splash Screen */
private static int SPLASH_TIME_OUT = 5000;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
new Handler().postDelayed(new Runnable()
{
/* THis method will run right after the execution of the splash finish */
@Override
public void run()
{ /* The Main Activity will be started */
Intent intent = new Intent(SplashScreenActivity.this, MainActivity.class);
startActivity(intent);
finish();
}
}, SPLASH_TIME_OUT);
}
}
Files Structure in the project
Thanks for your help. The problem was actually some packages that had renamed (I think wrong) and Android Studio was not identifying well what it should run. I redid the project with the packages from scratch and it worked.
– Laura Regina