OK Tôi mới dùng android dev và Java vì vậy tôi gặp vấn đề với phương pháp nhấp chuột ở đây là mã của tôi Tôi biết tôi phải cảm ơn trước tất cả những gì tôi muốn làm là khi nhấp vào điện thoại để chuyển đổi các quan điểm bố trí từ main.xml để xx.xmlNút Android Onclick
package my.project;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class ExperiencerlActivity extends Activity {
/** Called when the activ`enter code here`ity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button button = (Button) findViewById(R.id.button1);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
}
}
đây là mã nút của tôi
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/linearLayout1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="56dp"
android:onClick="setLogin"
android:text="Login" />
istill gặp lỗi bạn có thể hiển thị tất cả trong một? – user1344259
Tôi đã thay đổi mã này và thử một lần; – alishaik786