im trying to connect between my xml code to my java code on eclispe. i have a button called bt1. when im trying to do R.id.bt1- it doesnt recognize the bt1. meaning it did not get the xml code.. can you see wats wrong?
XML:`
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<Button
android:id="@+id/bt1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
/>
`
JAVA:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button btn=(Button) findViewById(R.id.bt1);