Commit 466c6ac8 authored by Shinryu's avatar Shinryu

Added Menu Item click to Profile

parent 3a70302a
...@@ -29,11 +29,11 @@ public final class R { ...@@ -29,11 +29,11 @@ public final class R {
public static final int prelimlogo=0x7f020003; public static final int prelimlogo=0x7f020003;
} }
public static final class id { public static final class id {
public static final int action_settings=0x7f080035; public static final int action_settings=0x7f080036;
public static final int btnAddMenu=0x7f080016; public static final int btnAddMenu=0x7f080016;
public static final int btnAddToCart=0x7f080032; public static final int btnAddToCart=0x7f080033;
public static final int btnAdmin=0x7f080029; public static final int btnAdmin=0x7f080029;
public static final int btnBack=0x7f080031; public static final int btnBack=0x7f080032;
public static final int btnCancel=0x7f080026; public static final int btnCancel=0x7f080026;
public static final int btnCart=0x7f080012; public static final int btnCart=0x7f080012;
public static final int btnConfigure=0x7f080007; public static final int btnConfigure=0x7f080007;
...@@ -61,8 +61,9 @@ public final class R { ...@@ -61,8 +61,9 @@ public final class R {
public static final int listview1=0x7f08000e; public static final int listview1=0x7f08000e;
public static final int logo=0x7f080003; public static final int logo=0x7f080003;
public static final int logout=0x7f08002c; public static final int logout=0x7f08002c;
public static final int textView00=0x7f080033; public static final int priceName=0x7f08002e;
public static final int textView01=0x7f080034; public static final int textView00=0x7f080034;
public static final int textView01=0x7f080035;
public static final int textView1=0x7f080018; public static final int textView1=0x7f080018;
public static final int textView2=0x7f08001a; public static final int textView2=0x7f08001a;
public static final int textView3=0x7f080028; public static final int textView3=0x7f080028;
...@@ -72,10 +73,10 @@ public final class R { ...@@ -72,10 +73,10 @@ public final class R {
public static final int textView7=0x7f080024; public static final int textView7=0x7f080024;
public static final int textView8=0x7f080004; public static final int textView8=0x7f080004;
public static final int textView9=0x7f08000b; public static final int textView9=0x7f08000b;
public static final int tvDesc=0x7f08002f; public static final int tvDesc=0x7f080030;
public static final int tvName=0x7f08002d; public static final int tvName=0x7f08002d;
public static final int tvPrice=0x7f08002e; public static final int tvPrice=0x7f08002f;
public static final int tvTags=0x7f080030; public static final int tvTags=0x7f080031;
public static final int txtItemName=0x7f080000; public static final int txtItemName=0x7f080000;
public static final int txtPass=0x7f08001b; public static final int txtPass=0x7f08001b;
public static final int txtPass2=0x7f080025; public static final int txtPass2=0x7f080025;
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
android:layout_height="wrap_content" > android:layout_height="wrap_content" >
<TextView <TextView
android:id="@+id/priceName"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Price:" android:text="Price:"
......
...@@ -102,6 +102,10 @@ public class Customer extends Activity { ...@@ -102,6 +102,10 @@ public class Customer extends Activity {
order.put("quantity", 1); order.put("quantity", 1);
order.saveInBackground(); order.saveInBackground();
Intent i = new Intent(getApplicationContext(), ViewProfile.class);
i.putExtra("menu_name", name);
startActivity(i);
}catch(Exception e) {} }catch(Exception e) {}
......
package com.cs123grpE.restaurantorderingsystem; package com.cs123grpE.restaurantorderingsystem;
import android.app.Activity; import android.app.Activity;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.TextView;
import com.parse.*;
public class ViewProfile extends Activity { public class ViewProfile extends Activity {
String itemname = "";
String description = "";
String tags = "";
double price = 0;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_profile); setContentView(R.layout.activity_view_profile);
Intent i = getIntent();
String name = i.getStringExtra("menu_name");
ParseObject x = null;
try{
x = (new ParseQuery("Menu_Item")).whereMatches("item_name", name).getFirst();
itemname = x.getString("item_name");
description = x.getString("item_desc");
//tags = x.getString("item_ingridients");
price = x.getDouble("item_price");
}catch(Exception e) {}
TextView ax = (TextView) findViewById (R.id.tvName);
TextView bx = (TextView) findViewById (R.id.priceName);
TextView cx = (TextView) findViewById (R.id.tvDesc);
ax.setText(itemname);
bx.setText(Double.toString(price));
cx.setText(description);
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment