0% found this document useful (0 votes)
0 views

Linear layout program

The document contains an XML layout for an Android application with three buttons: 'start_service', 'pause_service', and 'stop_service'. It also includes a Java class 'MainActivity' that sets the content view to the defined layout when the activity is created. The layout is designed to fill the parent view and is oriented vertically.

Uploaded by

kokanesanket24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Linear layout program

The document contains an XML layout for an Android application with three buttons: 'start_service', 'pause_service', and 'stop_service'. It also includes a Java class 'MainActivity' that sets the content view to the defined layout when the activity is created. The layout is designed to fill the parent view and is oriented vertically.

Uploaded by

kokanesanket24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

<?xml version="1.0" encoding="utf-8"?

>

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="vertical" >

<Button android:id="@+id/btnStartService"

android:layout_width="270dp"

android:layout_height="wrap_content"

android:text="start_service"/>

<Button android:id="@+id/btnPauseService"

android:layout_width="270dp"

android:layout_height="wrap_content"

android:text="pause_service"/>

<Button android:id="@+id/btnStopService"

android:layout_width="270dp"

android:layout_height="wrap_content"

android:text="stop_service"/>

</LinearLayout>
package com.example.demo;

import android.os.Bundle;

import android.app.Activity;

public class MainActivity extends Activity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

You might also like