« first day (1 day earlier)  last day (14 days later) » 

9:41 AM
I'm here
 
yup
here too :)
so where did we left?
 
just a sec
I opening Eclipse now
So very briefly
I have MainActivity which has 4 buttons
2 of them open same view(activity) and then third activity must be different
So what I've made
Buttons are restaurants and menues
 
yes2
dont need to explain from start
i mean your current code
 
In MainActivity i have
restaurants.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, Restaurants.class);
intent.putExtra("button", "restaurants");
startActivity(intent);

}
});
 
please paste in pastebin
 
9:47 AM
both buttons
menues.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, Restaurants.class);
intent.putExtra("button", "menues");
startActivity(intent);

}
});
 
ok just a listtle is ok
 
ok
 
ok in 2nd?
 
second activity is Restaurant which load from database some info for restaurants.
and here is the problem
if you click on button restaurants will open second activity whit all restaurants and you can click on single restaurant to see more info for him
if you click on menues on first activity again open all restaurants but now when you click on single restaurant should load menu fro this restaurant
third activity
 
yes i understood
show me your 2nd activiti's onCreate
 
9:51 AM
I've put this in second activity
            intent.putExtra("button", "restaurants");
            intent.putExtra("button", "menues");
 
wait
nooo
please post your complete 2nd activity in pastebin
 
only onCreate or full code?
 
full
if possible
to make sure we dont have miss communication :)
 
See onCreate and onItemCLick
you passed the intent with intent.putExtra("button", "restaurants");
but you dont catch that String, so its useless
 
10:02 AM
history cannot be resolved to a variable
what must be string?
so
i've made the correction
now in third activity
 
sorry what do u mean?
 
do I need to get this buttons in third activity?
 
hmmm
i dont understand
you need to pass the history to the 3rd
and catch it like i did in the 2nd
 
String btn = b.getString("button");
like this
 
yes you need it in the 3rd
it will either be restaurants or menues
 
10:08 AM
but
this mean that I must make menues in same activity?
I have one 3rd activity for button restaurants and one for menues
so I must catch String btn = b.getString("button"); also in menues activity?
 
you just need 1 3rd activity
and check the string's value
if the string is menu, show your menu
otherwise show the restaurants
 
hm
That's I don't know how to make it..
because my thoughts were just to copy/paste that source code from restaurants to menues and just to change the php file and query to db
this is my current code for third activity for restaurants
 
wait
do you understood my idea?
we have this history string
we just passing this history
 
yes
 
so after we passed it
we read it
to know what data should be displayed
 
10:21 AM
here I have 2 questions
1. with something like switch or if else to check for condition which activity to show.
and
2. where should I put now whole source code for the menues? Will take from DB image, text, name, price..
 
Okay if u dont understand where to put your code
just create 2 activities
its not a question i can answer
so from 2nd activity
use if else
 
well I really still can't understand this and can't find some tutorial or something where I can read.
so in second activity
in onCreate to put if block for whole current code and else to load menues?
also in this way should I change now buttons with different names like for example not history but 'restaurants' and 'menues'
 

« first day (1 day earlier)  last day (14 days later) »