Choose location? More like choose your error

So recently I have been attempting to create the option for the user to choose the location of where they wish to see deals from, one so that the app doesn’t show every single bar but also the user might be gooing on holiday or a day trip/night out to another town/city and want to pre plan. This will be done by typing in the action bar search view and then from the list, select the town they want. Sounds easy right, well……

So the initial part was easy, first of all I’ve got to grab all of the locations from the database and pull them down to the app, Okay that bit was easy as I’ve done it before. The hard bit was finding out how to create a searchview with a listview and theres not one tutorial online I could find that has the search being done with the actionbar. Why the hell is this not a thing? Therefore I’ve found a tutorial where they used a normal searchview on the apps page and I’m slowly manipulating this to work with the action bar.

First a lot of errors were due to not knowing if this code would do so or not, which as you could imagine lead to lots of messing around and changing/chopping up code. I formatted things to my way of coding which doesn’t always work as I hadn’t done this before so I soon had to learn a new way of doing some things. So after screaming at the code why it didn’t work, it did eventually and that’s when the next one appeared.

Another error was that when I was using the on click code from the listviewadapter t even just refresh the map it caused a Null error amongst others. This though was thank fully fixed by having learnt that a similar bit of code can be used on the main activity itself, it took longer than I would like to admit when it came to finally finding the fix, however it got fixed and I’m glad it was.

There were a few more to but luckily they got fixed and now to move onto the next part which is when an item is clicked it will refresh the map and filter it down to only the bars in that town

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s