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">
Related
The launcher icon of my app is not showing on any homescreens of my device, even though it's running. Going into app info, I can see that it is displaying the correct launcher icon.
My AndroidManifest.xml looks as follows:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher_round"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".Activities.SelectRoomScreen"
android:screenOrientation="landscape"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<category android:name="android.intent.category.HOME" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
</application>
Screenshot of mipmap
Screenshot of where it should appear next to My Application
As far as I can see, it should work. I've also tried adjusting the intent filter (removing any line except NDEF_DISCOVERED, HOME and LAUNCHER) but I'm either given an error or nothing is changing. What am I not seeing?
Thanks in advance!
In your manifest file, roundIcon is missing
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<application
android:allowBackup="true"
android:icon="#mipmap/logo"
android:label="#string/app_name"
android:roundIcon="#mipmap/logo"
android:supportsRtl="true"
android:theme="#style/Theme.Note">
<activity android:name=".activity.NoteActivity"></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=".activity.SettingsActivity"></activity>
</application>
I have integrated FCM into my app using react-native-firebase
When I background my app and receive a Push Notification, I want my app to resume from the background state.
It appears the onCreate() function from MainActivity is being called because I can see my SplashScreen.
Here's my AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="myapp">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="#style/AppTheme">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#drawable/notification_icon" />
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- Background Messages (Optional) -->
<service android:name="io.invertase.firebase.messaging.RNFirebaseBackgroundMessagingService" />
</application>
</manifest>
Set launchMode in your activity to avoid notifications from creating a new Activity instance.
Set launchMode of your SplashScreen to singleInstance.
Refer: https://developer.android.com/guide/topics/manifest/activity-element.html#lmode
Currently I am working with nfc reader. In this application nfc read tags and redirect to specific activity. But I want to redirect when user in background or app in kill state.
my manifest file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.adsmn.nfsreader">
<uses-feature
android:name="android.hardware.nfc"
android:required="true" />
<uses-permission android:name="android.permission.NFC" />
<application
android:hardwareAccelerated="false"
android:largeHeap="true"
android:allowBackup="true"
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:roundIcon="#drawable/app_icon"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Activity.Event_Executed"
android:screenOrientation="landscape"></activity>
<activity android:name=".Activity.VideoViewActivity"
android:screenOrientation="landscape"/>
<activity
android:launchMode="singleTask"
android:name=".Activity.Tech_Activation_Activity"
android:screenOrientation="landscape" />
<activity android:name=".Activity.MainActivity"
android:launchMode="singleTask"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<action android:name="android.nfc.action.ACTION_TAG_DISCOVERED" />
<data android:mimeType="text/plain" />
</intent-filter>
<!-- no need to use this when user to open deafualt app-->
<!-- <meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="#xml/nfc_tech_filter" />-->
</activity>
<activity android:name=".Activity.ViewPaigerClass"
android:launchMode="singleTask"
android:screenOrientation="landscape"></activity>
</application>
I have all ready tried some answer from stack overflow but none of them worked, So please tell me some thing that what I am doing wrong. Thanks in advance
You need to use deeplink for launching a specific Activity or Fragment.
And make your activity android:launchMode="singleTop"
Here is the reference for how to make deeplink.
For the fragment, you'd better to check Navigation Component.
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.
I've been following THIS tutorial to create a Widget with configuration activity. When you add the widget to the homescreen it shows the settings activity and changes the widget look accordingly. But after that you can't change the look.
However I would like for the settings activity to be separate, meaning that there is an icon in the apps menu and when you press it, settings show up and you can change the widget look.
I've tried changing the Main launcher in Android Manifest to the Settings activity, but it doesn't work. How can this be created?
AndroidManifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.wptrafficanalyzer.appwidgetclockconfiguration"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
</intent-filter>
</activity>
<activity android:name=".WidgetConfigurationActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
</intent-filter>
</activity>
<receiver android:name="AnalogClockWidgetProvider" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="#xml/widget_info" />
</receiver>
</application>
Try this, it works for me:
<activity
android:name=".WidgetConfigurationActivity"
android:launchMode="singleTop"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>