Menu
support@authoritypapers.com
+1(805) 568 7317

q 1 a modify the following android studio code so that it includesa button when clic 4949802

Q.1 a) Modify the following Android Studio code so that it includesa button when clicked it changes layout from relative tolinear. b) Also, I need to make microphone image to be able to enlargewhen clicked.
Java code :

package com.example.layoutdemo; import android.app.Activity;

import android.os.Bundle;

import android.view.Menu;

import android.view.MenuItem; public class MainActivity extends Activity { @Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.linear_layout1);

} @Override

public boolean onCreateOptionsMenu(Menu menu) {

// Inflate the menu; this adds items to the action bar if it ispresent.

getMenuInflater().inflate(R.menu.menu_main, menu);

return true;

} @Override

public boolean onOptionsItemSelected(MenuItem item) {

// Handle action bar item clicks here. The action bar will

// automatically handle clicks on the Home/Up button, so long

// as you specify a parent activity in AndroidManifest.xml.

int id = item.getItemId(); //noinspection SimplifiableIfStatement

if (id == R.id.action_settings) {

return true;

} return super.onOptionsItemSelected(item);

}

}
XML code for relativelayout: android_layout_width=”match_parent”

android:layout_height=”match_parent”

android:paddingLeft=”2dp”

android:paddingRight=”2dp”>

  

android:id=”@+id/cancelButton”

android:layout_width=”wrap_content”

android:layout_height=”wrap_content”

android:text=”Cancel” /> android_id=”@+id/saveButton”

android:layout_width=”wrap_content”

android:layout_height=”wrap_content”

android:layout_toRightOf=”@id/cancelButton”

android:text=”Save” />

  

   android_layout_width=”150dp”

android:layout_height=”150dp”

android:layout_marginTop=”230dp”

android:padding=”4dp”

android:layout_below=”@id/cancelButton”

android:layout_centerHorizontal=”true”

android:src=”@android:drawable/ic_btn_speak_now”

   /> android_id=”@+id/filter_button_container”

android:layout_width=”match_parent”

android:layout_height=”wrap_content”

android:layout_alignParentBottom=”true”

android:gravity=”center|bottom”

   android_background=”@android:color/white”

android:orientation=”horizontal” > android_id=”@+id/filterButton”

android:layout_width=”wrap_content”

android:layout_height=”fill_parent”

android:text=”Filter” /> android_id=”@+id/shareButton”

android:layout_width=”wrap_content”

android:layout_height=”fill_parent”

android:text=”Share” /> android_id=”@+id/deleteButton”

android:layout_width=”wrap_content”

android:layout_height=”fill_parent”

android:text=”Delete” />
XML code for linearlayout: android_orientation=”horizontal”

android:layout_width=”match_parent”

android:layout_height=”match_parent”>

  

android:src=”@android:drawable/btn_star_big_on”

android:layout_width=”wrap_content”

android:layout_height=”wrap_content”/> android_layout_width=”wrap_content”

android:layout_height=”wrap_content”

android:text=”@string/hello_world” />

android:layout_width=”wrap_content”

android:layout_height=”wrap_content”/>

   . . .

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon
"GET15"

Order Now