Twidere-App-Android-Twitter.../twidere/src/main/kotlin/org/mariotaku/twidere/activity/AssistLauncherActivity.kt

29 lines
1.1 KiB
Kotlin
Raw Normal View History

2016-07-02 05:54:53 +02:00
package org.mariotaku.twidere.activity
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import org.mariotaku.twidere.TwidereConstants.SHARED_PREFERENCES_NAME
import org.mariotaku.twidere.constant.IntentConstants.*
import org.mariotaku.twidere.constant.SharedPreferenceConstants.*
2017-04-17 15:10:14 +02:00
class AssistLauncherActivity : Activity() {
2016-07-02 05:54:53 +02:00
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
2017-04-17 15:10:14 +02:00
val prefs = getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE)
2020-06-08 23:09:07 +02:00
val action = when (prefs.getString(KEY_COMPOSE_NOW_ACTION, VALUE_COMPOSE_NOW_ACTION_COMPOSE)) {
2017-04-17 15:10:14 +02:00
VALUE_COMPOSE_NOW_ACTION_TAKE_PHOTO -> INTENT_ACTION_COMPOSE_TAKE_PHOTO
VALUE_COMPOSE_NOW_ACTION_PICK_IMAGE -> INTENT_ACTION_COMPOSE_PICK_IMAGE
else -> INTENT_ACTION_COMPOSE
2016-07-02 05:54:53 +02:00
}
val intent = Intent(action)
intent.flags = Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
intent.setClass(this, ComposeActivity::class.java)
startActivity(intent)
finish()
}
}