change default start activity error - android

This is my code
<?xml version="1.0" encoding="utf-8"?>
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET" />
<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=".RegisterActivity"/>
<activity
android:name=".SplashActivity"
android:exported="true" />
<activity
android:name=".LoginActivity"/>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" />
</application>
At the beginning, my project exported property is in the LoginActivity section.
But after I change exported="true" to SplashActivity it's not work...
I tried to change to RegisterActivity section and got the same error.
Event log is "Error running app: The activity must be exported or contain an intent-filter"
my android studio version is 2.3.3 and project min SDK is 19
Is there anyone have the same problem?..
Updare:
This is my latest code
<?xml version="1.0" encoding="utf-8"?>
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET" />
<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=".RegisterActivity"/>
<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" />
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" />
</application>
But I got the
same problem
...

try defining your Splash activity like this :
<activity
android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

In the Manifest file you must have an Activity that is set as Main so the app will know what to launch first.
By adding the following intent-filters you set the following Activity as main.
<activity
android:name=".Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Related

Android application is installing 2 times in device

I am getting multiple applications(with the same name) while installing this application, if I uninstall one other one gets deleted, in the beginning, the count was three but after making changes the count is two, now I want only single app ....how do ideal with this?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mypc.panjabisamajapp">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:hardwareAccelerated="false"
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" />
<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=".GirlsBoys">
</activity>
<activity android:name=".RegistrationForm" />
<activity android:name=".UploadPhoto" />
<activity android:name=".PopupOccupation" />
<activity android:name=".ContactDetailsForm" />
<activity android:name=".ParticularsForm" />
<activity android:name=".UserProfile" />
<activity android:name=".DisplayCardResult" />
<activity android:name=".ZoomImage" />
<activity android:name=".MenuActivity" />
<activity android:name="com.example.mypc.panjabisamajapp.MailBox"></activity>
<activity android:name=".ChatWindow" />
<activity android:name=".EditPProfile" />
<activity android:name=".UpdateDetails">
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="#array/preloaded_fonts" />
</application>
If the app names are the same the reason can be using multiple launcher intent in your manifest file. Check your merged manifest file instead of application manifest file.
i think u must have used this intent filter twice in multiple activities.check your manifest file

'The following app is part of another app' alert when uninstalling an app

I installed my signed apk on android emulator and when I tried to uninstall it, android made a dialog and said
MyApp is part of the following app: MyApp
do you want to uninstall this app?
I wanna know what makes android to make this dialog because my app(MyApp) is not part of another app
and this is my Manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.driver.android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.sec.android.provider.badge.permission.WRITE" />
<application
android:name=".global.Application"
android:allowBackup="false"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="false"
android:theme="#style/AppTheme">
<activity android:name=".activity.SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.HomeActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="home_activity"
android:scheme="app_driver" />
</intent-filter>
</activity>
<activity
android:name=".activity.ActivationActivity"
android:screenOrientation="portrait"
android:theme="#style/AppTheme"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".activity.LoginActivity"
android:screenOrientation="portrait"
android:theme="#style/AppTheme" />
<activity
android:name=".activity.NoInternetConnectionActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activity.ProfileActivity"
android:screenOrientation="portrait"
android:theme="#style/AppTheme2"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".activity.MapActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".activity.RequestActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
</application>
</manifest>
Same problem. But I resolved it after I located that there was 2 activities that has different labels.

error INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

i am getting this error while i am trying to run my app on my device.
I uninstall my app and it didnt works and everything on my manifest seems ok (for me jeje)
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name="menu.Activities.MainMenuActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar" />
<activity
android:name="menu.Activities.LoginActivity2"
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="menu.Activities.validateInfoActivity"
android:label="Confirmar informaciĆ³n" />
<service
android:name="services.notificationService"
android:enabled="true"
android:exported="true"></service>
<provider android:name="DataBase.businessCore"
android:authorities="com.mercasavip.business.core" android:exported="true"/>
</application>
Try to change capital letters to lowcase in your package name.

Why Custom Launcher doesn't work properly sometimes?

I created a custom launcher and set it to default launcher for my tablet. but when I open an application and then press Back button I will go to the last launcher(Default launcher of Samsung) although I setup my launcher as default before!
This is my launcher manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="launcher.base.app.ehsan.com.minelauncher">
<!-- To access internet -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- To auto-complete the email text field in the login form with the JSON's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.READ_PROFILE"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<application
android:name=".tools.G"
android:allowBackup="true"
android:icon="#mipmap/logo"
android:label="#string/app_name"
android:supportsRtl="false"
android:theme="#style/AppTheme">
<activity android:name=".activity.MainActivity">
</activity>
<activity
android:name=".activity.LoginActivity"
android:label="#string/title_activity_login"
android:theme="#android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
android:stateNotNeeded="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.ForgetActivity"
android:screenOrientation="sensorLandscape"
>
</activity>
<activity
android:name=".activity.RecoveryActivity"
android:screenOrientation="sensorLandscape"
>
</activity>
<service
android:name=".APIService.InternetService"
android:enabled="true"
android:exported="true"/>
</application>
</manifest>
Thank you for Your answers.

what permissions should i add in mainfest.xml

what permissions should i add in mainfest.xml of adroid studio for following app. Please help me. i am new developer.
https://play.google.com/store/apps/details?id=aa.bb.waqas.myapplication&hl=en
tell me about all permissions that i need to add it.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="aa1.bb.waqas.myapplication">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="IELTS Preparation In One Day"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".t1" />
<activity android:name=".MainActivity" />
<activity android:name=".t2" />
<activity android:name=".t3" />
<activity android:name=".t4" />
<activity android:name=".t5" />
<activity android:name=".t6" /><activity android:name=".t7" />
</application>
</manifest>
As you shared the link of application, there are only two permissions are needed
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
and You may need to add more permissions as per your requirements.

Categories

Resources