Android Custom Launcher Start Multiple Times -


i created simple launcher. started empty activity, after edited mainactivity , manifest. problem when device boot, launcher start, seems app start, closed after 4 seconds , instance start. need @ boot, launcher start once.

mainactivity:

import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.util.log;  public class mainactivity extends appcompatactivity {      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_main);         log.v("test", "1");     } } 

manifest:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mylauncher">  <application     android:allowbackup="true"     android:icon="@mipmap/ic_launcher"     android:label="@string/app_name"     android:roundicon="@mipmap/ic_launcher_round"     android:supportsrtl="true"     android:theme="@style/apptheme">     <activity android:name=".mainactivity">         <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> </application>  </manifest> 

try giving launch mode singletask

<activity   android:name=".mainactivity"             android:label="@string/app_name"             android:launchmode="singletask"             android:excludefromrecents="true"             > 

Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -