My app runs well and shows no errors, but my button is not working ( is unClickable in device)
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button11=(Button)findViewById(R.id.button11);
button11.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
new Intent(MainActivity.this, Main2Activity.class);
}
});
}
}
and XML file :
<Button
android:id="@+id/button11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50px"
android:layout_marginTop="200dp"
android:background="@color/colorPrimary"
android:text="صفحه اصلی"
android:onClick="onClick"/>/>
On the real device when I click on this button nothing happens !