0
How to make a simple menu program of Android?
tell the code of simple program of android application.
1 Odpowiedź
0
I've created a simple Android app below that creates a view with a text box and when the activity is initialised, the text is changed dynamically via Java.
src/main/Java/uk/co/hassie/simpleapp/MainActivity.java
import uk.co.hassie.simpleapp.R;
public class MainActivity extends AppCompatActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView textView = (TextView) findViewById(R.id.textView1);
textView.setText("Activity initialised");
}
src/main/res/layout/activity_home.xml
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView1
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Static text" />
</RelativeLayout>
I recommend that you read through the Android SDK documentation on Google's Developer Site. They provide really clear and detailed explanation with code examples.
It's the same way I learnt Android development, so I would recommend it.