Android - Launcher Application breaks after reboot phone - android

Here is my manifest:
<application
android:allowBackup="true"
android:icon="#drawable/toto"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:process=":app_process">
<activity
android:name=".core.Main"
android:label="app_label"
android:launchMode="singleTask"
android:alwaysRetainTaskState="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="#xml/nfc_tech_filter" />
</activity>
<service android:name=".core.MessengerService"
android:enabled="true"
android:process=":app_process">
<intent-filter>
<action android:name="My_Messenger_Service"/>
</intent-filter>
</service>
<receiver
android:name=".core.BootReceiver"
android:enabled="true"
android:label="StartMyServiceAtBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
My launcher breaks after reboot phone, then the phone asks me to choose the default launcher which contains Android default launcher and my launcher.
I tried to get logcat by using command line:
adb logcat -d > logcat.txt
But I didn't find any error log E/ of my launcher. How can I trace this error?
Can someone helps me pls? Thanks,

I added this param and it worked
android:clearTaskOnLaunch="true"

Related

Android assistant - MediaBrowserService - Voice command - "Play x on appName"

The voice commande Play [song] on [my appName] command not working, the "appName" is not being recognised by google assistante.
I followed the instruction form https://developer.android.com/guide/topics/media-apps/interacting-with-assistant and the demo app form https://github.com/android/uamp
My AndroidManifest:
<application
android:name=".XApplication"
android:allowBackup="false"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name" // app_name = appX 101.1
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="false"
android:theme="#style/AppTheme">
<activity
android:name=".ui.splash.SplashActivity"
android:exported="true"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.AppFullScreenTheme"
android:windowSoftInputMode="adjustPan|stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
...
...
<service
android:name="com.music.android.xx.media.MusicService"
android:enabled="true"
android:exported="true"
tools:ignore="ExportedService">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>
<service
android:name=".service.LocationUpdatesService"
android:foregroundServiceType="location" />
<receiver android:name=".service.StopServiceReceiver" />
<receiver android:name=".service.PlayRadioReceiver" />
<service
android:name=".service.MyFirebaseService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
I have a problem figuring out what I did wrong or what I missed . Any help will be greatly appreciated..
PS: My app had been in the store for 4days and my App Name have numbers in it like "appX 101.1" (i'm worried that this may be an issue)

Android - No Launcher activity found

When I launch my app with Eclipse, I get this error :
No Launcher activity found!
launch will only sync the application package on the device!
However, the AndroidManifest seems correct :
<application
android:name="com.myapp.MyApplication"
android:allowBackup="true"
android:largeHeap="true"
android:icon="#drawable/icon"
android:label="#string/name"
android:theme="#style/myTheme" >
<activity
android:name="com.myapp.OpeningActivity"
android:theme="#android:style/Theme.Holo.NoActionBar"
android:label="#string/name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="#xml/myxml" />
</activity>
<receiver android:name="com.myapp.MyBootReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.parrot.intent.action.LAUNCH_NAP_APP" />
</intent-filter>
</receiver>
</application>
I can't see anything worst in this code.
Note that with AndroidStudio, this error not appears. So... is Eclipse the problem ?
Thank you for your help.

App isnt installed widget android

Trying to test a widget.The Widget appear in the widget tab when I click on it, I get app is not installed toast message in Emulator
I don't really understand how widget works , so one more sub-question : I followed http://kasperholtze.com/android/how-to-make-a-simple-android-widget/ tutorial -> now I have this source code , perhaps I need to run it even once from an activity , how the code is compiled into the widget anyway?
Below is the manifest.
<receiver
android:name=".TimeWidget"
android:label="Time" >
<intent-filter>
<action android:name="android.intent.action.AIRPLANE_MODE"/>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/time_widget_provider" />
</receiver>
<activity
android:name="com.example.ass3.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=".ConfigurationActivity" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<activity android:name="IncCallHistory" android:label="Incoming Call History"></activity>
<activity android:name="TimeWidget" android:label="Time Widget"></activity>
</application>

My App Installs Two Applications - Android

Whenever I try to run my App, it installs two app in the emulator/device. I only want to Install my Main Activity, but the Splash Activity installs also. I know the problem is in the Manifest. Can anyone help me please? Here is my code:
<activity
android:name="com.android.upcurrents.launcher.SplashActivity"
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.android.upcurrents.MainActivity"
android:label="#string/app_name" />
You need to have only one activity to be declared as the launcher. So, remove the intent-filter from within the SplashActivity's tag, and add it to your MainActivity. The Launcher intent-filter should be present in only one of the activities in your manifest file.
It installs based on the intent filter you have provided.
Remove the following intent filter from SplashActivity and then put it in Main Activity
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
try this:
<activity
android:name="com.android.upcurrents.launcher.SplashActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.android.upcurrents.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>
I had this same problem but I fixed it with the making sure you only have one activity with:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
In my code I had two activities with that intent-filter, which caused two applications to be installed on my device.
We have the same problem but i fixed it this way
before my code below in manifest
<application
android:debuggable="true"
android:allowBackup="true">
<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="com.noupdate.apptest_noupdate.MainActivity"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Notice that in the SplashActivity inside the intent is this code
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
i only deleted the category
<category android:name="android.intent.category.LAUNCHER" />
So after i deleted the intent-filter category in splash it didn't install two app icon but only one for main the code will be like this notice that the intent-filter category is deleted
<application
android:debuggable="true"
android:allowBackup="true">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="com.noupdate.apptest_noupdate.MainActivity"
android:icon="#drawable/ic_launcher"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
it really helps

No Launcher activity found, despite being declared in manifest.xml

In my app I have the main activity defined in the manifest.xml file like this:
<activity
android:name=".MainActivity"
android:label="#string/guide_activity" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="#xml/searchable"/>
</activity>
when I run the project from eclipse connected to a real device or an emulator I receive the following message in the console:
No Launcher activity found
what can be the reason of this ?
Split the intent-filter into two seperate ones. If you mix them like this, android won't determine that one of the two is the launcher filter.
<activity
android:name=".MainActivity"
android:label="#string/guide_activity" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="#xml/searchable"/>
</activity>

Categories

Resources