My launcher activity not starting can any body tell me whats the problem.
I also have a service in it.
Any help is appreciated Please help i am stuck and don't know what to do.
Here is the code of Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="pelicans.abc.abc">
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-feature android:name="android.hardware.camera" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Permiss"
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=".MainActivity"
android:screenOrientation="portrait">
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable">
</meta-data>
</activity>
<service
android:name=".Service.FeatureService"
android:enabled="true">
</service>
<receiver android:name=".Receiver.RestartService"
android:enabled="true"
android:exported="true"
android:label="RestartServiceWhenStopped">
<intent-filter>
<action android:name="Restart_Service"></action>
</intent-filter>
</receiver>
</application>
</manifest>
Launcher activity is not called in any version of android.
Try this :
I think remove this:
<intent-filter>
<action android:name="Restart_Service"></action>
</intent-filter>
//need to modified
<meta-data
android:name="android.app.searchable" //it must contain package name and .searchable
android:resource="#xml/searchable">
</meta-data>
OR
<intent-filter>
<action android:name=".Restart_Service"></action> //add dot
</intent-filter>
really no log?..try more times,try to Log at application onCreate() and activity onCreate()
delete sth,like your MainActivity or RestartService,and try again
If launcher icon is working and launching from studio is not working, then disable Instant Run and try.
Related
I have an App that uses a Service that I've added by a Bindable Jar.
Current state:
this Jar has an own Manifest (see below), when I don't touch anything on this Manifest everything works as it should.
Problem:
This Jar lets on Deployment to Device always its launer AppIcon on Device.
So my App leaves finaly two launcher icons, the one desired and the other from the Jar.
My Approach was to delete follow Part from Manifest:
android:theme="#style/AppTheme">
<activity
android:name=".ScanDemoActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Doing this the App Crashed on BootUp with Error: BootReceiver not found ...
Deleting the next few Lines:
<receiver android:name="com.company.scandemo.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<category android:name="android.intent.category.HOME"/>
</intent-filter>
</receiver>
caused started correctly on bootUp, but the Service didn't come up on BOOT_COMPLETED, when I start the App via Launcher icon everything worked.
Wished Behaviour:
I want the Main App to leave only one launch Icon and startup correctly on Boot
Here is the Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.scandemo"
android:versionCode="1"
android:versionName="2.2" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".ScanDemoActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.company.scandemo.FloatingService" />
<receiver android:name="com.company.scandemo.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<category android:name="android.intent.category.HOME"/>
</intent-filter>
</receiver>
</application>
</manifest>
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.
I have livewallpaper, settings activity for livewallpaper and also standard MainActivity.
The point is that livewallpaper can't works with MainActivity together.
When my manifest looks like this:
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.BIND_WALLPAPER"/>
<uses-feature android:name="android.software.live_wallpaper" />
<application android:icon="#drawable/icon"
android:label="simea">
<!-- >android:permission="android.permission.BIND_WALLPAPER">-->
<service android:name=".LiveWallpaper"
android:label="#string/app_name"
android:icon="#drawable/icon">
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data android:name="android.service.wallpaper"
android:resource="#xml/livewallpaper" />
</service>
<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>
<activity android:label="#string/livewallpaper_settings"
android:name=".LiveWallpaperSettings"
android:theme="#android:style/Theme.Light.WallpaperSettings"
android:exported="true"
android:icon="#drawable/icon">
</activity>
</application>
I can run MainActivity, but I can't bind livewallpaper with my homescreen. I see preview of livewallpaper and I can change settings, but when I click "set wallpaper" button, there's no effect.
When I uncomment this line:
<!-- >android:permission="android.permission.BIND_WALLPAPER">-->
and comment this:
<uses-permission android:name="android.permission.BIND_WALLPAPER"/>
livewallpaper works great on my homescreen, but when I try to run MainActivity I get toast with message like this: "app is not installed on your phone".
How can I fix it?
the android:permission="android.permission.BIND_WALLPAPER" should be placed inside the service tag:
<service android:name=".LiveWallpaper"
android:label="#string/app_name"
android:icon="#drawable/icon"
android:permission="android.permission.BIND_WALLPAPER">
It's probably a very simple question but since I'm new to android development...
I am trying to start a service from an activity that is not in the same package (remote service) with the following code:
Intent i = new Intent("com.vasilis.service.GPSService");
i.putExtra("com.vasilis.service.GPSEnable", true);
this.startService(i);
but nothing happens with this code!
the manifest of the service project/package...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vasilis.service" android:versionCode="1" android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".serv_activity" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".GPSService" android:exported="true" android:enabled="true"></service>
<activity android:name=".incomingCallActivity" android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"></activity>
<receiver android:name="OnBootCompleteReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
</intent-filter>
</receiver>
</application>
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
</manifest>
I am missing something! Any help ?
A similar question was asked here: How do I start a service which is defined in a different package?
Pretty much you just need to add this to the manifest.xml
<service android:name=".GPSService" android:exported="true" android:enabled="true">
<intent-filter>
<action android:name="com.vasilis.service.GPSEnable" />
</intent-filter>
</service>
Or whatever the names of the classes are ;) If this doesn't seem to work, the documentation located at Service has a lot of good advice.
I think the error is from this manifest file ?!! when i want to start this activity "SearchResultForm" i have the exception ??
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ayanoo.forms"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/search" android:label="#string/app_name">
<activity android:name=".MainActivity" android:label="#string/app_name" android:launchMode="standard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="PersonDataForm" android:label="#layout/person_data_form"></activity>
<activity android:name="SearchResultForm" android:theme="#style/CodeFont"></activity>
<activity android:name="SendMessageForm" android:theme="#style/CodeFont"></activity>
</application>
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission>
</manifest>
You should have every activity of your appliaction listed within manifest file, like this:
<application android:icon="#drawable/ok" android:label="Application name">
<activity android:name=".main_screen.MyActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Your manifest has wrong links to your Activities (except the MainActivity).
You have:
<activity android:name="SearchResultForm" android:theme="#style/CodeFont"></activity>
Try to use:
<activity android:name=".SearchResultForm" android:theme="#style/CodeFont"></activity>
Pay attention to the dot.