Default Activity not found - android

when running my app it always goes to the edit configuration.
i found a solution in here but couldn't find the source tab in open module settings. Is there any other way to solve this? I'm using the latest version of android studio.
Thank you for the help.
this is my AndroidManifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mobapp.yurin.hkt">
<application android:allowBackup="true"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
</activity>
</application>

You didn't set the default launcher for the application. Try this:
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Related

Login screen isn't popping up

So I have a problem where I made a GUI for login window in android studio.But when I try to start the app,it doesn't pop up.Also I have made a splashcreen which I want to pop up before login screen and it does.Also,I didnt do anything in the LoginActivitiy file which was created.I can't find the problem.Here is the manifest file.
Btw Im a beginner,go easy on me :)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.projekat2021">
<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/Theme.Projekat2021">
<activity android:name=".MainActivity" />
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".LoginActivity" />
</application>
</manifest>

Activity class does not exist in android studio

I keep getting this error when I try to run my android studio. I tried to copy, paste my previous project bit by bit. After I finished it I got this error. I'm really stuck on this one.
Thanks in advance :D
This is my Activity manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.iussystem">
<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=".TermsOfService"></activity>
<activity android:name=".ForgotPassword" />
<activity android:name=".Registracija" />
<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>
If you are saying your app is in com/example/iusystem/MainActivity.java, isnt that a typo?
Either change your package:
package="com.example.iussystem"
to
package="com.example.iusystem"
Or move your activity the other way.

Different Activity starts on installation and lauch app, why?

I can't explain why my app starts the MainActivity on installation, but StartActivity on app launch.
To my knowledge, this is managed by the manifest.xml. But there I have the category.LAUNCHER and action.MAIN applied to the StartActivity and I want this task always to start first.
<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=".MainActivity"
android:label="#string/title_activity_main"
android:theme="#style/AppTheme.NoActionBar" />
<activity android:name=".StartActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ImageEditActivity"/>
</application>
Can someone tell me why the app is behaving like that? Any suggestion and review are welcome. Thank you in advance

Android Orientation Portrait layout only doesnt work

Sorry for this million times repeated answer, (Im a newbe in Andoid), but I cannot achieve to stay layout in Portrait orientation only. I've tried to set it with recommended
android:screenOrientation="portrait"
in Mainfest.xml (for Activity, (have just one)), but it doesn't work.
Anyone knows why ?
Below is my AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.leo.vj">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name_2"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="#array/preloaded_fonts" />
</application>
</manifest>
It seems you declared your main activity wrongly.Try this
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name_2"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="#array/preloaded_fonts" />
You missed configChanges. In the manifest, set this for all your activities:
<activity android:name=".YourActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
The above solution will work.
You have missed the config changes..
If you want to acheive through Code.
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
Attribute name mismatch screenOrientation is the correct one
Please see below
android:screenOrientation="portrait"
The Problem is there is an extra '>' in end in declaration
<activity
android:name = ".MainActivity">
android:screenOrientation = "portrait">
Change the Activity Declaration in to :
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<categoryandroid:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

Android Studio Apps Launcher missing but installed

I have read some other question about this problem and after trying,editing and inspecting my manifest , my Apps Launcher still doesnt appear
here is my manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.common.myappname">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MerchantActivity"
android:label="#string/title_activity_merchant"
android:theme="#style/AppTheme.NoActionBar">
</activity>
<activity
android:name=".SlidingTabsActivity"
android:label="#string/title_activity_voucher"
android:theme="#style/AppTheme.NoActionBar">
</activity>
</application>
</manifest>
Thanks, i appreciate any help offered.

Categories

Resources