IDE & Framework/Android

[Kotiln] 실행아이콘이 없는, 런처가 없는 앱 만들기

Greensky0026 2021. 11. 2. 23:58
반응형

시프트+시프트로 action search창으로 Edit Configurations 설정에 들어간다.

그리고 위와같이 설정하면, 런처가 없어도 실행가능.

 

 

실행시킬 앱의 Intent-filter action명 변경

<intent-filter>
    <action android:name="com.example.fcmautopopup" />
    <category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

 

실행부 변경

intent = Intent()
            intent.setPackage("com.example.fcmautopopup")
            intent.setAction("com.example.fcmautopopup")
            startActivity(intent)

하지만, 기존 실행한 앱은 사라지고 새 앱이 실행되었음.

 

 

flag추가해 별도의 task로 실행하도록 수정

intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)

 

 

[고려할 사항]

권한을 획득하고 자연스러운 종료

→ 권환획득 실패에 대한 정보를 intent로 런처에 정보를 보낸다

그리고 런처에서 권한에 대한 처리

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

반응형