我正在使用新Theme.AppCompat.DayNight
添加的Android Support Library 23.2
在Android 5.1上运行良好.
在Android 6.0上,活动看起来像使用灯光主题,但对话框看起来使用黑暗主题.
我的应用类:
public class MyApplication extends Application {
static {
AppCompatDelegate.setDefaultNightMode(
AppCompatDelegate.MODE_NIGHT_YES);
}
}
Run Code Online (Sandbox Code Playgroud)
我的styles.xml
<style name="AppTheme" parent="Theme.AppCompat.DayNight">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="Dialog.Alert" parent="Theme.AppCompat.DayNight.Dialog.Alert"/>
Run Code Online (Sandbox Code Playgroud)
我的代码显示一个对话框:
new AlertDialog.Builder(mContext, R.style.Dialog_Alert)
.setTitle("Title")
.setMessage("Message")
.show();
Run Code Online (Sandbox Code Playgroud) xml android android-layout android-theme android-support-library
这是我的c代码:
int main()
{
int a;
for (int i = 0; i < 3; i++)
scanf("%d ", &a);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
当我输入类似的东西时1 2 3
,它会要求我输入更多,我需要输入不是''的东西.
但是,当我将其更改为(或其他不是' '
)时
scanf("%d !", &a);
Run Code Online (Sandbox Code Playgroud)
和输入1 ! 2! 3!
,它不会要求更多的输入.
这些Google标签一起显示.
我试过,但它不起作用.意图标志我试过
FLAG_ACTIVITY_NEW_DOCUMENT
FLAG_ACTIVITY_MULTIPLE_TASK
FLAG_ACTIVITY_REORDER_TO_FRONT
Intent intent = new Intent(mActivity, ***.class);
intent.addFlags(***);
ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.AppTask> appTasks = activityManager.getAppTasks();
ActivityManager.AppTask appTask = appTasks.get(0);
appTask.startActivity(mActivity, intent, null);
Run Code Online (Sandbox Code Playgroud)