小编Pro*_*emy的帖子

打印时如何在 Fortran 中换行?

这是非常简单的查询,但我无法找到确切的解决方案。在 Fortran 中打印时如何换行?

例如

print*,'This is first line'
print*,'This is second line'
Run Code Online (Sandbox Code Playgroud)

我想要以下输出

This is first line

This is Second line
Run Code Online (Sandbox Code Playgroud)

即在两行之间添加空格。

在我们使用的 java 中\n,在 html 中使用可以<br>完成这项工作..但是如何在 Fortran 中实现相同的目标?

fortran gfortran

4
推荐指数
2
解决办法
8048
查看次数

将值从 Activity 传递到适配器

我有活动 A 和 B。活动 B 使用回收视图 Adpater 来显示信息列表。从活动 A 中,我将意图发送到用于工具栏标题的活动 B。但我在 Adapter 类中也需要相同的意图。

那么如何将 Intent 值从 Activity A 传递到 B,并在适配器类中也使用相同的 Intent。

我的活动 A 有代码

Intent new = new Intent(itemView.getContext(), B.class);
                phy.putExtra("key","This is title");   itemView.getContext().startActivity(new);
Run Code Online (Sandbox Code Playgroud)

在活动 B 中,我有

   getSupportActionBar().setTitle(getIntent().getStringExtra("key"));
Run Code Online (Sandbox Code Playgroud)

我也想要适配器类中的键值。

活动B的代码是

Intent new = new Intent(itemView.getContext(), B.class);
                phy.putExtra("key","This is title");   itemView.getContext().startActivity(new);
Run Code Online (Sandbox Code Playgroud)

我的适配器类有

   getSupportActionBar().setTitle(getIntent().getStringExtra("key"));
Run Code Online (Sandbox Code Playgroud)

提前致谢。

java android adapter android-arrayadapter android-intent

0
推荐指数
1
解决办法
1844
查看次数