How do I properly specify my starting activity in the android manifest? - android

This is my android manifest and for some reason my MainActivity does not start first. The activity that starts first whenever I run the application is RegisterActivity. Can anyone help me figure out why?
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.indigohate"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<permission
android:name="com.indigohate.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.indigohate.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<service android:name="com.indigohate.GCMIntentService" />
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.indigohate" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.indigohate" />
</intent-filter>
</receiver>
<activity
android:name="com.indigohate.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.indigohate.RegisterActivity"
android:launchMode="singleTop" />
<activity
android:name="com.indigohate.UserRegister"
android:launchMode="singleTop" />
<activity
android:name="com.indigohate.LoginActivity"
android:launchMode="singleTop" >
</activity>
<activity
android:name="com.indigohate.RideRequest"
android:label="#string/title_activity_ride_request" >
</activity>
<activity
android:name="com.indigohate.TimePickerFragment"
android:label="#string/title_activity_time_picker_fragment" >
</activity>
<activity
android:name="com.indigohate.SearchResultsListActivity"
android:launchMode="singleTop" />
<activity
android:name="com.indigohate.LoadingScreenActivity"
android:label="#string/title_activity_loading_screen" >
</activity>
<activity
android:name="com.indigohate.HomeActivity"
android:label="#string/title_activity_home" >
</activity>
<activity
android:name="com.indigohate.LostPasswordActivity"
android:label="#string/title_activity_lost_password" >
</activity>
<activity
android:name="com.indigohate.RideOfferActivity"
android:label="#string/title_activity_ride_offer" >
</activity>
<activity
android:name="com.indigohate.StartRideActivity"
android:label="#string/title_activity_start_ride" >
</activity>
<activity
android:name="com.indigohate.StopRideActivity"
android:label="#string/title_activity_stop_ride" >
</activity>
<activity
android:name="com.indigohate.CalendarActivity"
android:label="#string/title_activity_calendar" >
</activity>
<activity
android:name="com.indigohate.ProfileActivity"
android:label="#string/title_activity_profile" >
</activity>
<activity
android:name="com.indigohate.MakeCommentActivity"
android:label="#string/title_activity_make_comment" >
</activity>
<activity
android:name="com.indigohate.PaymentInformationActivity"
android:label="#string/title_activity_payment_information" >
</activity>
<activity
android:name="com.indigohate.RideHistoryActivity"
android:label="#string/title_activity_ride_history" >
</activity>
</application>
</manifest>

It's because you kept this attribute in your RegisterActivity
android:launchMode="singleTop"
Remove all these launchmodes in all activities. Keep it only in your MainActivity:
<activity
android:name="com.indigohate.MainActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
The starting activity contains <category android:name="android.intent.category.LAUNCHER" /> to ensure that it's a launcher activity when an app starts.

Related

Showing two Icons when launch application

I want some assistance on Icons showing for my application, there are two icons one for my Library Project FBReader and one for my own launcher app. I make all changes as suggested on different web portals and StackOverflow but didn't get success. Please suggest me any solution regarding the same.
AndroidManifest.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.handygo.rockasap"
android:installLocation="auto"
android:versionCode="70"
android:versionName="4.3.3" >
<!-- android:maxSdkVersion="17" max version create problem in Reader -->
<uses-sdk android:minSdkVersion="9" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.READ_SYNC_STATS" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!--
<permission
android:name="com.handygo.rockasap.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
-->
<uses-permission android:name="com.handygo.rockasap.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive data message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- <uses-feature
android:name="android.permission.ACCESS_FINE_LOCATION"
android:required="false" />
<uses-feature
android:name="android.permission.ACCESS_COARSE_LOCATION"
android:required="false" />
<uses-feature
android:name="android.permission.SEND_SMS"
android:required="false" />
<uses-feature
android:name="android.hardware.location"
android:required="false" />
<uses-feature
android:name="android.hardware.location.network"
android:required="false" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="false" />-->
<uses-feature
android:name="android.hardware.telephony"
android:required="false" >
</uses-feature>
<!-- Version check the WIFI and Location permission -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />
**<application
tools:replace="android:icon, android:label, android:name, android:theme"
android:allowBackup="true"
android:icon="#mipmap/app_icon"
android:label="#string/app_name"
android:largeHeap="true"
android:name=".RockstandApplication"
android:theme="#style/AppTheme" >**
<!-- MOBIKWIK Activity Files -->
<activity
android:name="com.mobikwik.sdk.MobikwikSDK"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="MobiKwik"
android:theme="#style/MKSDKTransparent"
android:windowSoftInputMode="stateHidden" >
</activity>
<!-- PayTM Activity -->
<activity
android:name="com.paytm.pgsdk.PaytmPGActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:theme="#style/AppTheme" >
</activity>
<activity
android:name="com.mobikwik.sdk.PGWebView"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="BankPage"
android:theme="#style/MKSDKTheme"
android:windowSoftInputMode="stateHidden" >
</activity>
<activity
android:name="com.mobikwik.sdk.PaymentOptions"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/app_name"
android:theme="#style/MKSDKTheme"
android:windowSoftInputMode="stateHidden" >
</activity>
<activity
android:name="com.mobikwik.sdk.PaymentActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/app_name"
android:theme="#style/MKSDKTheme"
android:windowSoftInputMode="stateHidden" >
</activity>
<activity
android:name="com.mobikwik.sdk.GetUserDetailsActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/app_name"
android:theme="#style/MKSDKTheme"
android:windowSoftInputMode="stateHidden" >
</activity>
<!-- multiwindow code -->
<meta-data
android:name="com.samsung.android.sdk.multiwindow.enable"
android:value="true" />
<meta-data
android:name="com.samsung.android.sdk.multiwindow.multiinstance.enable"
android:value="true" />
<meta-data
android:name="com.sec.android.multiwindow.STYLE"
android:value="fixedRatio" />
<meta-data
android:name="com.sec.android.support.multiwindow"
android:value="true" />
<service android:name="com.handygo.rockasap.apputils.GCMIntentService" />
<receiver
android:name="com.handygo.rockasap.apputils.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.handygo.rockasap" />
</intent-filter>
</receiver>
<provider
android:name="com.handygo.rockasap.DataProvider"
android:authorities="com.handygo.rockasap.DataProvider"
android:exported="true"
android:multiprocess="true" >
</provider>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="org.geometerplus.android.fbreader.crash.FixBooksDirectoryActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":crash"
android:theme="#style/FBReader.Dialog" >
<intent-filter>
<action android:name="android.fbreader.action.CRASH" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="CachedCharStorageException" />
</intent-filter>
</activity>
<activity
android:name="org.geometerplus.android.fbreader.crash.MissingNativeLibraryActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":crash"
android:theme="#style/FBReader.Dialog" >
<intent-filter>
<action android:name="android.fbreader.action.CRASH" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="ExceptionInInitializerError" />
</intent-filter>
</activity>
<service
android:name="org.geometerplus.android.fbreader.api.ApiService"
android:exported="false"
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.fbreader.action.API" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
<activity
android:name="com.artifex.mupdfdemo.ScreenShotsActivity"
android:theme="#android:style/Theme.Translucent.NoTitleBar" >
</activity>
<activity
android:name="org.geometerplus.android.fbreader.SpeakActivity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Light.Panel" />
**<activity
tools:replace="android:icon, android:label, android:name, android:theme"
android:name="org.geometerplus.android.fbreader.FBReader"
android:configChanges="orientation|keyboardHidden|screenSize"
android:icon="#mipmap/app_icon"
android:label="Rockstand"
android:launchMode="singleTask"
android:theme="#style/FBReader.Activity" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
</activity>**
<activity android:name="org.geometerplus.android.fbreader.DictionaryBrowser" />
<activity
android:name="org.geometerplus.android.fbreader.CancelActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="#style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.style.StyleListActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="#style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.style.EditStyleActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="#style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.image.ImageViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="#style/FBReader.Activity" />
<!-- android:process=":imageView" -->
<service
android:name="org.geometerplus.android.fbreader.libraryService.LibraryService"
android:exported="false"
android:launchMode="singleTask"
android:process=":libraryService" >
<intent-filter>
<action android:name="android.fbreader.action.LIBRARY_SERVICE" />
</intent-filter>
</service>
<activity
android:name="org.geometerplus.android.fbreader.library.BookInfoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":library"
android:theme="#style/FBReader.Activity" />
<activity
android:name="org.geometerplus.android.fbreader.library.LibrarySearchActivity"
android:process=":library"
android:theme="#android:style/Theme.NoDisplay" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
</activity>
<activity
android:name="org.geometerplus.android.fbreader.library.LibraryActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTask"
android:process=":library"
android:theme="#style/FBReader.Activity" >
<meta-data
android:name="android.app.default_searchable"
android:value="org.geometerplus.android.fbreader.library.LibrarySearchActivity" />
</activity>
<activity
android:name="org.geometerplus.android.fbreader.TOCActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="#style/FBReader.Activity" />
<activity
android:name="org.geometerplus.android.fbreader.BookmarksActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="#style/FBReader.Activity" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
</activity>
<activity
android:name="org.geometerplus.android.fbreader.BookmarkEditActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="#style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.preferences.PreferenceActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="#style/FBReader.Activity" />
<activity
android:name="org.geometerplus.android.fbreader.preferences.EditBookInfoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":library"
android:theme="#style/FBReader.Activity" />
<activity
android:name="org.geometerplus.android.fbreader.network.BookDownloader"
android:process=":networkLibrary"
android:theme="#android:style/Theme.NoDisplay" >
</activity>
<service
android:name="org.geometerplus.android.fbreader.network.BookDownloaderService"
android:launchMode="singleTask"
android:process=":networkLibrary" />
<activity
android:name="org.geometerplus.android.fbreader.network.NetworkSearchActivity"
android:process=":networkLibrary"
android:theme="#android:style/Theme.NoDisplay" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
</activity>
<activity
android:name="org.geometerplus.android.fbreader.network.NetworkLibraryPrimaryActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTask"
android:process=":networkLibrary"
android:theme="#style/FBReader.Activity" >
</activity>
<activity
android:name="org.geometerplus.android.fbreader.network.NetworkLibrarySecondaryActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="#style/FBReader.Activity" />
<activity
android:name="org.geometerplus.android.fbreader.network.AuthenticationActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="#style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.network.BuyBooksActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="#style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.network.AddCatalogMenuActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="#style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.network.AddCustomCatalogActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="#style/FBReader.Dialog" >
</activity>
<activity
android:name="org.geometerplus.android.fbreader.network.AuthorizationMenuActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="#style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.network.TopupMenuActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="#style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.network.NetworkBookInfoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="#style/FBReader.Activity" >
</activity>
<activity
android:name="com.artifex.mupdfdemo.MuPDFActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:theme="#android:style/Theme.Light.NoTitleBar.Fullscreen" >
</activity>
<receiver
android:name="org.geometerplus.android.fbreader.network.ListenerCallback"
android:process=":networkLibrary" >
<intent-filter>
<action android:name="android.fbreader.action.network.SIGNIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<!--
<activity
android:name="com.handygo.rockasap.screens.MainActivity"
android:screenOrientation="sensorPortrait"
android:theme="#style/AppTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
-->
<activity
android:name=".SplashActivity"
android:launchMode="singleTask"
android:screenOrientation="sensorPortrait"
android:theme="#style/AppTheme"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".RockstandFragmentScreenActivity"
android:configChanges="screenSize|keyboardHidden|orientation"
android:label="#string/title_activity_filters"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize|adjustPan"></activity>
<!-- The authenticator service -->
<receiver
android:name="com.handygo.rockasap.services.ReferralReceiver"
android:enabled="true"
android:exported="true"
android:permission="android.permission.INSTALL_PACKAGES" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<service
android:name="com.handygo.rockasap.services.AuthenticationService"
android:exported="false" >
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="#xml/authenticator" />
</service>
<!--<receiver
android:name="com.handygo.rockasap.UpdatePaymentSuccess">
<intent-filter>
<action android:name="update_paytm" />
</intent-filter>
</receiver>-->
</application>
</manifest>
Because you put two intent filters,remove one
<activity
android:name="org.geometerplus.android.fbreader.crash.FixBooksDirectoryActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":crash"
android:theme="#style/FBReader.Dialog" >
<intent-filter>
<action android:name="android.fbreader.action.CRASH" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="CachedCharStorageException" />
</intent-filter>
</activity>
<activity
android:name="org.geometerplus.android.fbreader.crash.MissingNativeLibraryActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":crash"
android:theme="#style/FBReader.Dialog" >
<intent-filter>
<action android:name="android.fbreader.action.CRASH" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="ExceptionInInitializerError" />
</intent-filter>
</activity>
Thats because you have 2 LAUNCHER activities in your manifest
<activity
android:name=".SplashActivity"
android:launchMode="singleTask"
android:screenOrientation="sensorPortrait"
android:theme="#style/AppTheme"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
</activity>
The 2 line
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
are both launchers. Remove 1
The other answers are correct, either remove the intentfilters or set the category of either to android.intent.category.DEFAULT
Note that if you dont declare it to DEFAULT, the compiler does it for you automatically.

Supported devices is 0-Google play

Manifest:
This was working fine before some time. Now it shows 0-supported devices!
Please help me on this.
Shows these features on console though I am not using it.
android.hardware.screen.PORTRAIT
android.hardware.TOUCHSCREEN
android.hardware.WIFI
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.irb.wallpro"
android:versionCode="5"
android:versionName="1.0.5" >
<uses-sdk
android:minSdkVersion="8"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- Include next permission if you want to allow UIL to cache images on SD card -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<application
android:name="com.irbrothers.wallpro.ui.WallProApplication"
android:allowBackup="true"
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.irbrothers.wallpro.ui.SplashActivity"
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>
<activity
android:name="com.irbrothers.wallpro.ui.PropertiesActivity"
android:configChanges="orientation"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.irbrothers.wallpro.ui.HomeActivity"
android:configChanges="orientation|screenSize"
android:launchMode="singleTask" >
</activity>
<activity
android:name="com.irbrothers.wallpro.ui.EULA"
android:configChanges="orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.irbrothers.wallpro.ui.AboutActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="com.startapp.android.publish.list3d.List3DActivity"
android:taskAffinity="com.app.irbrothers.wallpro.AppWall"
android:theme="#android:style/Theme" />
<activity
android:name="com.startapp.android.publish.AppWallActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:taskAffinity="com.app.irbrothers.wallpro.AppWall"
android:theme="#android:style/Theme.Translucent" />
<service android:name="com.irbrothers.wallpro.alarm.NotificationService" />
<receiver android:name="com.irbrothers.wallpro.recievers.NotificationAlarmReciever" >
<intent-filter>
<action android:name="com.irbrothers.notification" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DATE_CHANGED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.TIME_SET" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.TIME_TICK" />
</intent-filter>
</receiver>
</application>
</manifest>
Solved
Do not use any library which is already present in framework. Ex: "json-simple" here.

How do i declare my Activity as Launcher?

I am trying to build a kind of custom lockscreen.
In order to achieve that I need to disable the HOME button.
From this post I understand that I can achieve that by declaring my Activity as a Launcher.
Please how do I do that? (it is in the Manifest obviously)
This is the Manifest.
The Activity that "acts" as a lockscreen is LockScreen
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.appengine.paranoid_android.lost"
android:versionCode="2"
android:versionName="1.1" >
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".InfoSetup"
android:clearTaskOnLaunch="true"
android:label="#string/activity_name"
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".LockScreen"
android:clearTaskOnLaunch="true"
android:label="#string/activity_name"
android:launchMode="singleInstance"
android:theme="#android:style/Theme.NoTitleBar" >
<service
android:name=".InfoService"
android:label="#string/service_name" />
<receiver android:name="com.appengine.paranoid_android.lost.BootCompleteReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_CHANGED" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
</activity>
</application>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<!-- <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/> -->
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" >
</uses-sdk>
Move the intent filter to your activity
<activity
android:name=".LockScreen"
android:clearTaskOnLaunch="true"
android:label="#string/activity_name"
android:launchMode="singleInstance"
android:theme="#android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Change order of activity to open first

I am working on a project, where i have 4 activities. Each time i run the project, activityA opens first and then other activities, but i want that the MainActivity should open first and then other activities.
Where should i define the order of activities to open.
Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.it"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".ActivityA"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity" />
<activity android:name=".GeneralAct" />
<activity android:name=".BackUp" />
<activity android:name=".AccountSettings" />
</application>
</manifest>
You need
<category android:name="android.intent.category.LAUNCHER" />
within the activity tag for MainActivity.
<activity
android:name=".MAinActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Define MainActivity as,
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
and all other activities as,
<activity
android:name=".ActivityA"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Launcher Activity is opened first and then the Default Activities.
Just Replace your manifest with this code..
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.it"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".ActivityA"
android:label="#string/app_name" >
</activity>
<activity android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".GeneralAct" />
<activity android:name=".BackUp" />
<activity android:name=".AccountSettings" />
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".yourmainactivityname"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Activity1 -->
<activity android:name=".Activity1" />
<!-- Activity2 -->
<activity android:name=".Activity2 " />
<!-- Activity3 -->
<activity android:name=".Activity3 " />
<!-- Activity4 -->
<activity android:name=".Activity4" />
</application>
The Activity you want to open first must have a intent filter with category description as:
<category android:name="android.intent.category.LAUNCHER"/>
Here is the complete Activity declaration in Android Menifest:
<activity
android:name=".MainActivity"
android:theme="#style/app_theme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Error when installing android application

I trying to use C2DM in my android application, but after I added it I can't install the application. I get this error "Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED". But I can't see whats wrong.
Anyone that know what I have done wrong?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Wordy.Game"
android:versionCode="1"
android:versionName="0.1"
android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="8" />
<permission
android:name="Wordy.Game.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission
android:name="Wordy.Game.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<application android:label="#string/app_name" android:icon="#drawable/wordy">
<activity android:name="Main"
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>
<receiver
android:name=".C2DMRegistrationReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter >
<action android:name="com.google.android.c2dm.intent.REGISTRATION" >
</action>
<category android:name="Wordy.Game" />
</intent-filter>
</receiver>
<receiver
android:name=".C2DMRegistrationReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter >
<action android:name="com.google.android.c2dm.intent.RECEIVE" >
</action>
<category android:name="Wordy.Game" />
</intent-filter>
</receiver>
<activity android:name="Result" android:label="#string/app_name" android:screenOrientation="portrait" />
<activity android:name="PlayField" android:label="#string/app_name" android:screenOrientation="portrait" />
<activity android:name="Game" android:label="#string/app_name" android:screenOrientation="portrait" />
<activity android:name="News" android:label="#string/app_name" android:screenOrientation="portrait" />
<activity android:name="PlayOnline" android:label="#string/app_name" android:screenOrientation="portrait" />
<activity android:name="UsersOnline" android:label="#string/app_name" android:screenOrientation="portrait" />
</application>
</manifest>
I finally found whats wrong, the package name on the application was not allowed to start with capital letter.
try prefixing your activityies with a . or the full package name:
<activity android:name="com.gizm0.YourClass"></activvity>
or
<activity android:name=".YourClass"></activvity>

Categories

Resources