Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 6th, 2013  |  syntax: None  |  size: 6.03 KB  |  views: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:tools="http://schemas.android.com/tools"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:background="@drawable/icon"
  6. tools:context=".MainActivity" >
  7.  
  8. <Button
  9.     android:id="@+id/curries"
  10.     android:layout_width="150dp"
  11.     android:layout_height="130dp"
  12.     android:layout_alignParentRight="true"
  13.     android:layout_alignTop="@+id/tiffins"
  14.     android:drawableBottom="@drawable/curries"
  15.     android:text="@string/Curries"
  16.     android:onClick="CurriesMenu"/>
  17.  
  18. <Button
  19.     android:id="@+id/tiffins"
  20.     style="@style/AppTheme"
  21.     android:layout_width="150dp"
  22.     android:layout_height="130dp"
  23.     android:layout_alignParentLeft="true"
  24.     android:layout_alignParentTop="true"
  25.     android:layout_marginTop="40dp"
  26.     android:drawableBottom="@drawable/tiffins"
  27.     android:text="@string/Tiffins"
  28.     android:onClick="TiffinsMenu"/>
  29.  
  30. <TextView
  31.     android:id="@+id/textView2"
  32.     android:layout_width="100dp"
  33.     android:layout_height="30dp"
  34.     android:layout_alignBottom="@+id/textView1"
  35.     android:layout_alignParentLeft="true"
  36.     android:layout_marginLeft="19dp"
  37.     android:text="@string/Tiffins"
  38.     android:textSize="25dp" />
  39.  
  40. <TextView
  41.     android:id="@+id/textView1"
  42.     android:layout_width="100dp"
  43.     android:layout_height="30dp"
  44.     android:layout_above="@+id/curries"
  45.     android:layout_alignLeft="@+id/curries"
  46.     android:layout_marginLeft="24dp"
  47.     android:text="@string/Curries"
  48.     android:textSize="25dp" />
  49.  
  50. <TextView
  51.     android:id="@+id/textView3"
  52.     android:layout_width="100dp"
  53.     android:layout_height="30dp"
  54.     android:layout_alignLeft="@+id/textView2"
  55.     android:layout_centerVertical="true"
  56.     android:text="@string/Snacks"
  57.     android:textSize="25dp" />
  58.  
  59. <Button
  60.     android:id="@+id/Snacks"
  61.     android:layout_width="150dp"
  62.     android:layout_height="130dp"
  63.     android:layout_alignParentLeft="true"
  64.     android:layout_below="@+id/textView3"
  65.     android:drawableBottom="@drawable/snacks"
  66.     android:text="@string/Snacks"
  67.     android:onClick="SnacksMenu" />
  68.  
  69. <TextView
  70.     android:id="@+id/textView4"
  71.     android:layout_width="100dp"
  72.     android:layout_height="30dp"
  73.     android:layout_alignBaseline="@+id/textView3"
  74.     android:layout_alignBottom="@+id/textView3"
  75.     android:layout_alignLeft="@+id/curries"
  76.     android:layout_alignParentRight="true"
  77.     android:text="@string/Pindivantalu"
  78.     android:textSize="25dp" />
  79.  
  80. <Button
  81.     android:id="@+id/pindivantalu"
  82.     android:layout_width="150dp"
  83.     android:layout_height="130dp"
  84.     android:layout_alignBottom="@+id/Snacks"
  85.     android:layout_alignParentRight="true"
  86.     android:drawableBottom="@drawable/pindivantalu"
  87.     android:text="@string/Pindivantalu"
  88.     android:onClick="PindivantaluMenu" />
  89.        
  90. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  91. xmlns:tools="http://schemas.android.com/tools"
  92. android:layout_width="match_parent"
  93. android:layout_height="match_parent"
  94. tools:context=".DisplayTiffinsmenu" >
  95.  
  96. <ListView
  97.     android:id="@+id/listView1"
  98.     android:layout_width="match_parent"
  99.     android:layout_height="wrap_content"
  100.     android:layout_alignParentLeft="true"
  101.     android:layout_centerVertical="true"
  102.     android:background="@drawable/tiffins1"
  103.     android:entries="@array/tiffinslist" >
  104.  
  105. </ListView>
  106.        
  107. package com.example.andhrarecipies;
  108.  
  109. import android.os.Bundle;
  110. import android.app.Activity;
  111. import android.content.Intent;
  112. import android.view.Menu;
  113. import android.view.View;
  114.  
  115. public class MainActivity extends Activity {
  116.  
  117.     @Override
  118.     protected void onCreate(Bundle savedInstanceState) {
  119.         super.onCreate(savedInstanceState);
  120.         setContentView(R.layout.activity_main);
  121.     }
  122.  
  123.     @Override
  124.     public boolean onCreateOptionsMenu(Menu menu) {
  125.         // Inflate the menu; this adds items to the action bar if it is present.
  126.         getMenuInflater().inflate(R.menu.activity_main, menu);
  127.         return true;
  128.     }
  129.  
  130.     public void TiffinsMenu(View view){
  131.         Intent intent = new Intent(this, DisplayTiffinsmenu.class);
  132.         startActivity(intent);
  133.     }
  134.  
  135.     public void CurriesMenu(View view){
  136.         Intent intent = new Intent(this, DisplayCurriesmenu.class);
  137.         startActivity(intent);
  138.     }
  139.  
  140.     public void SnacksMenu(View view){
  141.         Intent intent = new Intent(this, DisplaySnacksmenu.class);
  142.         startActivity(intent);
  143.     }
  144.  
  145.     public void PindivantaluMenu(View view){
  146.         Intent intent = new Intent(this, DisplayPindivantalumenu.class);
  147.         startActivity(intent);
  148.  
  149.     }
  150.  
  151. }
  152.        
  153. package com.example.andhrarecipies;
  154.  
  155. import java.util.ArrayList;
  156.  
  157. import android.os.Bundle;
  158. import android.app.Activity;
  159. import android.app.ListActivity;
  160. import android.view.Menu;
  161. import android.view.View;
  162. import android.widget.ArrayAdapter;
  163. import android.widget.ListView;
  164. import android.widget.Toast;
  165.  
  166. public class DisplayTiffinsmenu extends ListActivity {
  167.  
  168.     @Override
  169.     protected void onCreate(Bundle savedInstanceState) {
  170.         super.onCreate(savedInstanceState);
  171.  //      setContentView(R.layout.activity_display_tiffinsmenu);
  172.  
  173.         ListView TiffinsMenu = (ListView) this.findViewById(R.id.listView1);
  174.         String[] menu = getResources().getStringArray(R.array.tiffinslist);
  175.  
  176.         setListAdapter(new ArrayAdapter<String>(this, R.layout.activity_display_tiffinsmenu, menu));
  177.  
  178.     }
  179.  
  180.     @Override
  181.     protected void onListItemClick(ListView l, View v, int position, long id) {
  182.         // TODO Auto-generated method stub
  183.         super.onListItemClick(l, v, position, id);
  184.         Object o = this.getListAdapter().getItem(position);
  185.         String keyword = o.toString();
  186.             Toast.makeText(this, "you have selected" + keyword, Toast.LENGTH_LONG).show() ;
  187.     }
  188.  
  189.     @Override
  190.     public boolean onCreateOptionsMenu(Menu menu) {
  191.         // Inflate the menu; this adds items to the action bar if it is present.
  192.         getMenuInflater().inflate(R.menu.activity_display_tiffinsmenu, menu);
  193.         return true;
  194.     }
  195.  
  196. }
  197.        
  198. <ListView
  199.   android:id="@android:id/list"
  200.   android:layout_width="match_parent"  
  201.   android:layout_height="wrap_content" >  
  202. </ListView>