Click here to Skip to main content
15,867,308 members
Home / Discussions / Android
   

Android

 
GeneralRe: How to get only one restaurant when I press click button one click Pin
ahmed_sa4-Jun-16 20:04
ahmed_sa4-Jun-16 20:04 
GeneralRe: How to get only one restaurant when I press click button one click Pin
Richard MacCutchan4-Jun-16 21:11
mveRichard MacCutchan4-Jun-16 21:11 
GeneralRe: How to get only one restaurant when I press click button one click Pin
ahmed_sa5-Jun-16 2:44
ahmed_sa5-Jun-16 2:44 
GeneralRe: How to get only one restaurant when I press click button one click Pin
Richard MacCutchan5-Jun-16 3:25
mveRichard MacCutchan5-Jun-16 3:25 
QuestionRe: How to get only one restaurant when I press click button one click Pin
David Crow5-Jun-16 12:32
David Crow5-Jun-16 12:32 
AnswerRe: How to get only one restaurant when I press click button one click Pin
ahmed_sa6-Jun-16 7:39
ahmed_sa6-Jun-16 7:39 
GeneralRe: How to get only one restaurant when I press click button one click Pin
David Crow6-Jun-16 7:45
David Crow6-Jun-16 7:45 
GeneralRe: How to get only one restaurant when I press click button one click Pin
ahmed_sa12-Jun-16 4:47
ahmed_sa12-Jun-16 4:47 
I modify my code above as following
I storage the parsed ArrayList, make a global variable for counting the number of times that the button has been clicked.
public class MainActivity extends ListActivity {
ArrayList<foursquarevenue> venuesList;
Button btn;
int clickCount;

// ArrayList<foursquarevenue> allResults;

List<string> shownResults = new ArrayList<string>();


final String CLIENT_ID = "SVIBXYYXOEARXHDI4FWAHXGO5ZXOY204TCF1QJFXQLY5FPV4";
final String CLIENT_SECRET = "BAAJO1KXRWESGTJJGVON4W3WUFHAQDAJPLRIYJJ5OPHFQ5VI";
final String latitude = "30.435665153239377";
final String longtitude = "31.3280148";
ArrayAdapter <string> myAdapter;

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new fourquare().execute();
btn=(Button) findViewById(R.id.button);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v)
{

String name = venuesList.get(clickCount).getName();

String cat = venuesList.get(clickCount).getCategory();

String city = venuesList.get(clickCount).getCity();

shownResults.add(name + "," + "cat" + "" + city);

clickCount++;

myAdapter.notifyDataSetChanged();
new fourquare().execute();

}
});

}
what is wrong in my code
QuestionRe: How to get only one restaurant when I press click button one click Pin
David Crow13-Jun-16 1:52
David Crow13-Jun-16 1:52 
QuestionAndroid Pin
maymoona4-Jun-16 5:50
maymoona4-Jun-16 5:50 
AnswerRe: Android Pin
David Crow4-Jun-16 16:01
David Crow4-Jun-16 16:01 
QuestionNew beginer to android Pin
hmanhha3-Jun-16 6:51
hmanhha3-Jun-16 6:51 
AnswerRe: New beginer to android Pin
David Crow3-Jun-16 10:28
David Crow3-Jun-16 10:28 
AnswerRe: New beginer to android Pin
Richard MacCutchan3-Jun-16 22:43
mveRichard MacCutchan3-Jun-16 22:43 
AnswerRe: New beginer to android Pin
AkhilSreekar19-Jun-16 9:41
AkhilSreekar19-Jun-16 9:41 
Questionhow to retrieve or get next item from json file when press click button listner Pin
ahmed_sa3-Jun-16 3:05
ahmed_sa3-Jun-16 3:05 
QuestionRe: how to retrieve or get next item from json file when press click button listner Pin
David Crow3-Jun-16 4:05
David Crow3-Jun-16 4:05 
AnswerRe: how to retrieve or get next item from json file when press click button listner Pin
ahmed_sa3-Jun-16 12:34
ahmed_sa3-Jun-16 12:34 
GeneralRe: how to retrieve or get next item from json file when press click button listner Pin
ahmed_sa3-Jun-16 13:08
ahmed_sa3-Jun-16 13:08 
SuggestionRe: how to retrieve or get next item from json file when press click button listner Pin
Richard MacCutchan3-Jun-16 22:42
mveRichard MacCutchan3-Jun-16 22:42 
GeneralRe: how to retrieve or get next item from json file when press click button listner Pin
ahmed_sa4-Jun-16 1:02
ahmed_sa4-Jun-16 1:02 
GeneralRe: how to retrieve or get next item from json file when press click button listner Pin
Richard MacCutchan4-Jun-16 1:06
mveRichard MacCutchan4-Jun-16 1:06 
GeneralRe: how to retrieve or get next item from json file when press click button listner Pin
David Crow4-Jun-16 3:16
David Crow4-Jun-16 3:16 
QuestionRe: how to retrieve or get next item from json file when press click button listner Pin
David Crow4-Jun-16 3:16
David Crow4-Jun-16 3:16 
AnswerRe: how to retrieve or get next item from json file when press click button listner Pin
ahmed_sa4-Jun-16 11:24
ahmed_sa4-Jun-16 11:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.