i am beginner in android,and i write this code in ADT v22.6.2:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment())
.commit();
}
//this is my code
TextView tbx = (TextView)findViewById(R.id.tbxName);
tbx.setText("H.H");
}
but when i launch program -> Unfortunately,app has stopped
Edit:
<FrameLayout
xmlns:android="schemas.android.com/apk/res/android"; xmlns:tools="schemas.android.com/tools";
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.t.MainActivity"
tools:ignore="MergeRootFrame" >
<TextView
android:id="@+id/tbx"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
\</FrameLayout>
please help me. thanks