1

I dont want Launcher icon for my app but when I am removing.

<intent-filter>                
 <action android:name="android.intent.action.MAIN" />                 
<category android:name="android.intent.category.LAUNCHER" />            
 </intent-filter> 

even only removing

<category android:name="android.intent.category.LAUNCHER" />

My manifest is as below

<?xml version="1.0" encoding="utf-8"?>

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" />
<application
    android:allowBackup="true"

    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <service
        android:name=".ShakeDetectService"
        android:enabled="true"
        android:exported="true" />

    <receiver
        android:name=".MyServiceReceiver"
        android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </receiver>

    <activity android:name=".MainActivity"
        android:theme="@android:style/Theme.Translucent.NoTitleBar">
     </activity>
</application>

Android studio is giving error Error Launching activity Please give me your valuable suggestion. Thank you

Rishikesh pathak
  • 423
  • 4
  • 18
  • possible duplicate of http://stackoverflow.com/questions/8134884/android-how-to-programmatically-hide-launcher-icon – Smit Aug 16 '16 at 12:03
  • Ignore the error message , the application also installed in you phone. – cowboi-peng Aug 16 '16 at 12:08
  • i have given broadcast receiver to receive BOOT of device.but it is not working.Same broadcast receiver is working when i am giving in my activity in manifest. – Rishikesh pathak Aug 16 '16 at 12:21

2 Answers2

0

Go to:
1. Run --> Edit Configuration
2. Under your app tab (default opened tab) change the Launch Options to Nothing

Note: your app won't be running after installation without external help (Broadcast messages)

enter image description here

Nir Duan
  • 6,164
  • 4
  • 24
  • 38
0
  • open run/debug configurations from android studio
  • choose edit
  • configurations select your module from left panel from general tab
  • choose launch option as -> 'Nothing'
alian
  • 204
  • 1
  • 12