是否可以自动设置字体大小match_parent?
我TextView已经,width/height="match_parent"但字体很小,不适合父母大小.
怎么做?
考虑以下类:
class A {
void print() {
System.out.println("A");
}
}
class B extends A implements C {
}
public interface C {
void print();
}
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
继承的方法A.print()无法隐藏C中的公共抽象方法
现在,我明白print()为了消除编译错误必须公开,但这背后的原因是什么?
当我运行该命令时,activator h2-browser它使用以下URL打开浏览器:
192.168.1.17:8082
但我得到(使用Chrome):
此网页无法使用
奇怪的是它以前真的有效.从那以后我唯一改变的是JAVA_OPTS为了启用调试.我重新安装了Java,我认为现在没有环境变量JAVA_OPTS.
无论如何,它为什么会发生?
更新
更奇怪的是,当我按下view-source时,我得到一个包含此公告的网页(这是网页的一部分):
<h1>Welcome to H2</h1>
<h2>No Javascript</h2>
If you are not automatically redirected to the login page, then
Javascript is currently disabled or your browser does not support Javascript.
For this application to work, Javascript is essential.
Please enable Javascript now, or use another web browser that supports it.
Run Code Online (Sandbox Code Playgroud)
但是我确实启用了Javascript(我通过检查设置验证了它,并且还尝试了Firefox)
其他信息
我正在使用Java 1.8,我不知道JAVA_OPTS在更改它之前有什么价值,遵循本教程:http: //andikanugraha.com/2014/05/debug-typesafe-activator-play-framework-使用-蚀/
我完全删除了Java并重新安装它.我想现在根本没有JAVA_OPTS变数.
这是我的数据库配置:
db.default.driver="org.h2.Driver"
db.default.url="jdbc:h2:file:main2.db"
db.default.user=sa
db.default.password=""
Run Code Online (Sandbox Code Playgroud) 考虑以下类:
public class Base {
protected int i = 0;
public Base(int i) {
this.i = i;
}
public Base(Base b) {
this(b.i);
}
public Base foo() {
return new Base(this);
}
}
public class Sub extends Base {
public Sub(int i) {
super(i);
}
public Sub(Sub s) {
super(s.i * 2);
}
public Base foo() {
return this;
}
@Override
public boolean equals(Object o) {
return ((Sub) o).i == this.i;
}
public static void main(String[] args) {
Base b1 …Run Code Online (Sandbox Code Playgroud) 我正在尝试将int变量传递给另一个活动:
从当前的活动:
Intent intent = new Intent(getApplicationContext(),PlayActivity.class);
intent.putExtra("position", position);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
在PlayActivity.onCreate:
Intent intent = getIntent();
String position = intent.getStringExtra("position");
int index = Integer.parseInt(position);
Run Code Online (Sandbox Code Playgroud)
问题是,位置总是null(并parseInt()抛出异常).
为什么?