我有一个线性布局,我设置为clikable + focus,但问题是点击时没有显示焦点.如何才能显示焦点.
继承我的代码
<LinearLayout
android:id="@+id/linear_tv_layout"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:clickable="true"
android:focusable="true"
android:paddingBottom="7px">
Run Code Online (Sandbox Code Playgroud) 我试图比较两个edittext框的值.我想要的是比较passw1 = passw2.因为我的代码现在比较我输入的两个字符串,因为我无法比较它们.
final EditText passw1= (EditText) findViewById(R.id.passw1);
final EditText passw2= (EditText) findViewById(R.id.passw2);
Button buttoks = (Button) findViewById(R.id.Ok);
buttoks.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
if (passw1.toString().equalsIgnoreCase("1234") && passw2.toString().equalsIgnoreCase("1234")){
Toast.makeText(getApplication(),"Username and password match", Toast.LENGTH_SHORT).show();
}
else {
Toast.makeText(getApplication(),"Username and password doesn't match", Toast.LENGTH_SHORT).show();
}
} });
Run Code Online (Sandbox Code Playgroud)