用户如何更改应用程序的启动活动?

时间:2015-07-02 14:18:28

标签: java android android-activity

用户(未注册未登录)如何更改应用程序的启动活动?

我需要代码:

  1. 首次在设备输出活动上运行应用程序以选择国家/地区(不是本地化 - 内容的差异)。

  2. 保存选择设置后,当您运行活动时,将运行所选国家/地区。

  3. 能够更改显示的活动中的设置。

  4. 甚至可能吗?

    用户必须选择自己选择2-3活动中的一个,该活动仅与内容不同。

1 个答案:

答案 0 :(得分:4)

我会设置一个像require (ggplot2) # Create vectors: breaks and corresponding labels as multiples of pi/2 vec.breaks <- seq(from = pi/2, to = 7*pi/2, by = pi/2) pi.halfs <- c(paste(expression(pi), "/2"), paste(seq(from = 3, to = 21, by = 2), "*" , expression(pi), "/2")) pi.fulls <- c(paste(expression(pi)), paste(seq(from = 2, to = 11, by = 1), "*" , expression(pi))) vec.expr <- parse(text = c(rbind(pi.halfs, pi.fulls)))[1:7] # Create some time and signal time <- seq(from = 0, to = 4*pi, by = 0.01) signal <- sin(time) df <- data.frame(time,signal) # Now plot the signal with the new x axis labels fig <- ggplot(data = df, aes(x = time, y = signal)) + geom_line() + scale_x_continuous(breaks=vec.breaks, labels=vec.expr) print(fig) int一样存储的设置。您可以将其存储在enum

您将拥有SharedPreferences个入口点,MainActivity会立即读取该设置并重定向到右侧onCreate()

<强>的伪代码:

SettingsActivity:

选项:活动1 /活动2 /活动3:

Activity

https://developer.android.com/training/basics/data-storage/shared-preferences.html

MainActivity:

SharedPreferences.edit().putInt("entryPoint", 2).apply();