-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
app/src/main/java/com/puutaro/commandclick/activity_lib/ExecMainActivityLaunchIntent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.puutaro.commandclick.activity_lib | ||
|
||
import android.content.Intent | ||
import com.puutaro.commandclick.activity.MainActivity | ||
import com.puutaro.commandclick.common.variable.settings.FannelInfoSetting | ||
import com.puutaro.commandclick.util.state.FannelInfoTool | ||
|
||
object ExecMainActivityLaunchIntent { | ||
fun launch( | ||
activity: MainActivity, | ||
){ | ||
val execIntent = Intent(activity, activity::class.java) | ||
execIntent.action = Intent.ACTION_MAIN | ||
execIntent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP | ||
val startUpPref = FannelInfoTool.getSharePref(activity) | ||
val currentAppDirPath = FannelInfoTool.getStringFromFannelInfo( | ||
startUpPref, | ||
FannelInfoSetting.current_app_dir | ||
) | ||
FannelInfoTool.putAllFannelInfo( | ||
startUpPref, | ||
currentAppDirPath = currentAppDirPath, | ||
currentFannelName = FannelInfoSetting.current_fannel_name.defalutStr, | ||
onShortcutValue = FannelInfoSetting.on_shortcut.defalutStr, | ||
currentFannelState = FannelInfoSetting.current_fannel_state.defalutStr | ||
) | ||
activity.finish() | ||
activity.startActivity(execIntent) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters